Configuration Functions



Configuration Functions in SQL Server


Configuration functions in SQL server return information about current configuration option settings.

All the configuration functions are listed below:


FunctionDescription
@@DATEFIRSTReturns the current value, for a session, of SET DATEFIRST, which specifies the first day of the week.
--SYNTAX--

@@DATEFIRST


FunctionDescription
@@DBTSReturns the value of the current timestamp data type for the current database.
--SYNTAX--

@@DBTS

FunctionDescription
@@LANGIDReturns the local language identifier (ID) of the language that is currently being used.
--SYNTAX--

@@LANGID
FunctionDescription
@@LANGUAGEReturns the name of the language currently being used.
--SYNTAX--

@@LANGUAGE
FunctionDescription
@@LOCK_TIMEOUTReturns the current lock time-out setting in milliseconds for the current session
--SYNTAX--

@@LOCK_TIMEOUT
FunctionDescription
@@MAX_CONNECTIONSReturns the maximum number of simultaneous user connections allowed on an instance of SQL Server.
--SYNTAX--

@@MAX_CONNECTIONS
FunctionDescription
@@MAX_PRECISIONReturns 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
FunctionDescription
@@NESTLEVELReturns 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
FunctionDescription
@@OPTIONSReturns 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
FunctionDescription
@@REMSERVERReturns 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
FunctionDescription
@@SERVERNAMEReturns 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

FunctionDescription
@@SERVICENAMEReturns 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


FunctionDescription
@@SPIDReturns 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
FunctionDescription
@@TEXTSIZEReturns the current value of TEXTSIZE option.
--SYNTAX--

@@TEXTSIZE
FunctionDescription
@@VERSIONReturns the version, processor architecture, build date, and operating system for the current installation of SQL Server.
--SYNTAX--

@@VERSION

Connection String

SQL Server Connection String Formats

posted on 2019-08-27 05:53:53 - SQL Server Tutorials


UNION

union in SQL server

posted on 2019-08-09 23:05:33 - SQL Server Tutorials


System Functions

System Functions in SQL Server

posted on 2019-08-09 06:14:33 - SQL Server Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials