SqlServer Global variables are predefined by the system

the SELECT  @@ the CONNECTIONS  - Returns the number of connections since the last start or trying to connect. 
SELECT  @@ CURSOR_ROWS  - return connection (the number of rows to be returned valid data has not yet been opened cursor row read) the number of qualifying rows last open cursor currently exist 
SELECT  @@ DATEFIRST  - Back Weekly the first day figures 
the SELECT  @@ eRROR  - returns an error code of the last executed SQL statements. 
the SELECT  @@ FETCH_STATUS  - return status is the last cursor FETCH statement is executed, rather than the status of any currently open connections cursor. 
SELECT  @@ the IDENTITY  - returns the last inserted identity value, global 
SELECT  the SCOPE_IDENTITY () - returns the last inserted identity value, the range of the 
SELECT  @@ LANGID  - returns the local language identifier currently used language (ID) . 
the SELECT  @@ LANGUAGE  - Returns the name of the language currently in use.
SELECT  @@ the LOCK_TIMEOUT  - Returns the current lock current session timeout setting in milliseconds. 
SELECT  @@ PROCID  - Returns procedure stored identifier (ID) of the current process. 
the SELECT  @@ ROWCOUNT  - Returns the number of rows affected by the last statement. 
the SELECT  @@ SERVERNAME  - Returns the local name server is running. 
the SELECT  @@ SPID  - Returns the server process identifier (ID) of the current user process. 
the SELECT  @@ TRANCOUNT  - Returns the number of currently active connections affairs. 
the SELECT  @@ VERSION  - Returns the date, version and type of processor currently installed. 
the SELECT  @@ CPU_BUSY  - return since SQL Server last started working CPU time in milliseconds, 
the SELECT  @@ DATEFIRST  - Returns SET DATEFIRST command DATAFIRST parameter is assigned the value of SET DATEFIRST, command to specify the week The first day of the week
the SELECT  @@ DBTS  - Returns the current timestamp value database must ensure the database timestamp value is only 
the SELECT  @@ ERROR  - returns an error code execute Transact-SQL statements in 
the SELECT  @@ FETCH_STATUS  - returns to the last FETCH statement the state values 
the SELECT  @@ IDLE  - return unit length of time since the last start SQL Server CPU is empty closed state of milliseconds 
the SELECT  @@ io_busy  - returns the CPU to perform input and output operations since the last time SQL Server starts spent time in milliseconds, to 
select  @@ LANGID  - returns the language ID value currently used in 
select  @@ the lANGUAGE  - returns the name of the currently used language 
select  @@ the LOCK_TIMEOUT  - returns the current session length of time waiting for a lock in milliseconds, 
select  MAX_CONNECTIONS @@  - returns the maximum number of connections allowed to connect to SQL Server
SELECT  @@ MAX_PRECISION  - Returns the data type of decimal and numeric precision 
SELECT  @@ NESTLEVEL  - Returns the stored procedure nesting level currently executed initial value 0 
SELECT  @@ the OPTIONS  - returns the current option information SET 
SELECT  @ @PACK_RECEIVED  - returns the number of input packets read SQL Server via the network 
SELECT  @@ pack_sent  - returns the number of output packets addressed to SQL Server network 
SELECT  @@ packet_errors  - returns the number of errors in the packet network 
SELECT  @@ PROCID  - - returns the ID value currently stored procedure 
the SELECT  @@ REMSERVER  - returns the name of a remote SQL server database server, 
the SELECT  @@ SERVICENAME  -SQL Server is running to return to the state under which service the SQLServerAgent MSDTC as the MSSQLServer 
the SELECT  @@ SPID  - Returns the server process ID value of the current user process 
the SELECT  @@ TEXTSIZE  - return TEXTSIZE option values SET statement SET statement defines the SELECT statement the maximum length of the basic units of text or image data type byte 
SELECT  @@ TimeTicks  - returns the number of microseconds each clock 
SELECT  @@ total_errors  - returns the number of disk read and write error 
SELECT  @@ total_read  - returns the disk read operation the number of 
the SELECT  @@ TOTAL_WRITE  - returns the number of disk writes 
the SELECT  @@ TRANCOUNT  - returns the current connection is active in number of transactions

 

- the same point: identity value is returned last inserted 
- differences: 
- @@ Identity: Returns the last session identifier value, is not limited to a specific scope; 
- IDENT_CURRENT ( 'TableName'): return any Finally, a session identification value of the specified table, any scope of generated; 
- SCOPE_IDENTITY: returns the current session identifier value of the current scope of any last generated table.

 

Published 259 original articles · won praise 2 · views 10000 +

Guess you like

Origin blog.csdn.net/hofmann/article/details/104026884