Search notes:

SQL Server session

The id of the current session is stored in @@spid.

Obtaining some session info

select
  @@spid            as ses_id,
  session_user      as ses_usr,
  current_user      as cur_usr,
  system_user       as sys_usr,
  user_name()       as nam_usr,
  user              as usr
;
Github repository about-MSSQL, path: /architecture/session/spid-user-etc.sql

Killing a session

A session (or more accurately a process) can be killed with the kill statement.
c:\> sqlcmd -A
select blocked from sys.dm_exec_requests where blocked <> 0;
go
.... some numbers returned ...
kill 42
go

Session language

The session language determines
The session language is set with set language …

See also

architecture
Settings that pertain to a session can be altered with the set statement.
sp_who and sp_who2.
db-off-on.sql is a script that offlines and onlines a database, thus making sure that no session is running on the database afterwards.

Index