Configuration Functions in SQL Server
Configuration functions in SQL server return information about current configuration option settings.
All the configuration functions are listed below:
Function | Description |
---|---|
@@DATEFIRST | Returns the current value, for a session, of SET DATEFIRST, which specifies the first day of the week. |
--SYNTAX--
@@DATEFIRST
Function | Description |
---|---|
@@DBTS | Returns the value of the current timestamp data type for the current database. |
--SYNTAX--
@@DBTS
Function | Description |
---|---|
@@LANGID | Returns the local language identifier (ID) of the language that is currently being used. |
--SYNTAX--
@@LANGID
Function | Description |
---|---|
@@LANGUAGE | Returns the name of the language currently being used. |
--SYNTAX--
@@LANGUAGE
Function | Description |
---|---|
@@LOCK_TIMEOUT | Returns the current lock time-out setting in milliseconds for the current session |
--SYNTAX--
@@LOCK_TIMEOUT
Function | Description |
---|---|
@@MAX_CONNECTIONS | Returns the maximum number of simultaneous user connections allowed on an instance of SQL Server. |
--SYNTAX--
@@MAX_CONNECTIONS
Function | Description |
---|---|
@@MAX_PRECISION | Returns the precision level used by decimal and numeric data types as currently set in the server.By default, the maximum precision returns 38. |
--SYNTAX--
@@MAX_PRECISION
Function | Description |
---|---|
@@NESTLEVEL | Returns the nesting level of the current stored procedure execution (initially 0) on the local server. Each time a stored procedure calls another stored procedure or executes managed code by referencing a common language runtime (CLR) routine, type or aggregate, the nesting level is incremented.When the maximum of 32 is executed, the transaction is terminated. |
--SYNTAX--
@@NESTLEVEL
Function | Description |
---|---|
@@OPTIONS | Returns information about the current SET options. SET options can be modified as a whole by using the sp_configure user options configuration option. Each user has an @@OPTIONS function that represents the configuration. |
--SYNTAX--
@@OPTIONS
Function | Description |
---|---|
@@REMSERVER | Returns the name of the remote SQL Server database server as it appears in the login record. @@REMSERVER enables a stored procedure to check the name of the database server from which the procedure is run. |
--SYNTAX--
@@REMSERVER
Function | Description |
---|---|
@@SERVERNAME | Returns the name of the local server that is running SQL Server. SQL Server Setup sets the server name to the computer name during installation. To change the name of the server, use sp_addserver, and then restart SQL Server. |
--SYNTAX--
@@SERVERNAME
Function | Description |
---|---|
@@SERVICENAME | Returns the name of the registry key under which SQL Server is running. @@SERVICENAME returns 'MSSQLSERVER' if the current instance is the default instance; this function returns the instance name if the current instance is a named instance. |
--SYNTAX--
@@SERVICENAME
Function | Description |
---|---|
@@SPID | Returns the session ID of the current user process. This is called the server process ID in earlier versions of SQL Server. @@SPID can be used to identify the current user process in the output of sp_who. |
--SYNTAX--
@@SPID
Function | Description |
---|---|
@@TEXTSIZE | Returns the current value of TEXTSIZE option. |
--SYNTAX--
@@TEXTSIZE
Function | Description |
---|---|
@@VERSION | Returns the version, processor architecture, build date, and operating system for the current installation of SQL Server. |
--SYNTAX--
@@VERSION
SQL Server Connection String Formats
posted on 2019-08-27 05:53:53 - SQL Server Tutorials