Select APP_NAME () as w -- Application of the current session
Select @ ERROR -- return the ERROR code (integer) of the last executed Transact-SQL statement)
Select @ IDENTITY -- return the last inserted id value
SELECT USER_NAME () -- returns the user database username
Select @ ERROR -- return the ERROR code of the last executed Transact-SQL statement
SELECT @ CONNECTIONS -- returns the number of CONNECTIONS or attempts since the last SQL startup.
Select getdate () -- current time
SELECT @ CPU_BUSY/100 -- returns the CPU time since the last SQL statement was started, in milliseconds
USE tempdb SELECT @ DBTS as w -- returns the current timestamp data type value for the current database. This timestamp value must be unique in the database.
Select @ IDENTITY as w -- return the last inserted id value
SELECT @ IDLE as w -- returns the IDLE time of the SQL statement since it was last started, in milliseconds
SELECT @ IO_BUSY AS w -- returns the time (in milliseconds) of the SQL statement used to perform input and output operations after the last startup.
SELECT @ langid as w -- returns the local language identifier (ID) of the current language ).
SELECT @ language as w -- returns the current LANGUAGE name
SELECT @ LOCK_TIMEOUT as w -- set the current lock timeout for the current session, in milliseconds.
SELECT @ MAX_CONNECTIONS as w -- returns the maximum number of simultaneous user connections allowed on SQL. The number returned does not need to be the currently configured value.
EXEC sp_configure -- display the global configuration settings of the current server
SELECT @ MAX_PRECISION as w -- return the precision level used by the decimal and numeric data types, that is, the currently set precision on this server. The default maximum precision is 38.
Select @ OPTIONS as w -- returns information about the current SET option.
SELECT @ PACK_RECEIVED as w -- returns the number of input data packets read from the network after SQL is started.
SELECT @ PACK_SENT as w -- return the number of output data packets written to the network by SQ since the last start.
SELECT @ PACKET_ERRORS as w -- returns the number of network packet errors that have occurred on the SQL connection since the SQL startup.
SELECT @ SERVERNAME as w -- return the name of the running SQL Server.
SELECT @ SERVICENAME as w -- return the registry key name that is running under the SQL statement.
SELECT @ TIMETICKS as w -- returns the number of microseconds at a scale on the SQL server.
SELECT @ TOTAL_ERRORS AS w -- returns the number of disk read/write errors that the SQL Server encounters after it is started.
SELECT @ TOTAL_READ as w -- returns the number of times the SQL Server reads the disk after it is started.
SELECT @ TOTAL_WRITE as w -- return the number of times the SQL server writes data to the disk after it is started.
SELECT @ TRANCOUNT as w -- returns the number of active transactions for the current connection.
SELECT @ VERSION as w -- returns the date, VERSION, and processor type of the SQL Server installation.