Global Variables in SQL Server - Part2
Posted by vaddilli sarat
under Sql Server
on 11/5/2012 for Beginner level | Points: 250
| Views : 1982
If you found plagiarised (copied)
or inappropriate content,
please let us know
the original source along with your correct email id (to communicate) for further action.
let us learn the global variables in the sql server , in my last article we had already learned about global variables and we also learned the first 10 global variables .This article is continuation to the Global Variables in Sql Server Part-1
In this article we are going to learn the global variables in the Sql Server , in my last article on global variables we had learned about global variables and the usage of first 10 global variables in Sql Server .
To visit the first part of this article, click here.
List of second 10 Global Variables and their usage are included below:
1)@@LANGID : The local language id of the language currently in use(specified in syslanguages.langid).By default it will return 0 because the language id of the english is 0.we can set the language id based on our requirement.
@@LANGID as Language_ID
2)@@LANGUAGE : The name of the language currently in use (specified in
syslanguages.name).By default it will return us_english Language.
@@LANGUAGE as System_Language
3)@@LOCK_TIMEOUT : Number of milliseconds the connection will wait for a source that is currently blocked . After that time period the connection will time out and retuen an error.
@@LOCK_TIMEOUT AS LOCKTIMEOUT
4)@@MAX_CONNECTIONS : The maximum number of simultaneous connections that can be made with
SQL Server in this computer environment. The user can configure SQL Server for
any number of connections less than or equal to the value of
@@max_connections with sp_configure ''number of user
@@MAX_CONNECTIONS AS MAXIMUMCONNECTIONS
5)@@MAX_PRECISION : Maximum precision allowed for decimal and numeric data types
6)@@NESTLEVEL : The current level of stored procedure nesting. If there are no currently executing nested procedures then this variable is zero
7)@@OPTIONS : Returns a bitmask of currently active SET options. Some SET options can be altered by each user, however, each connection starts up with the same options, as configured by the system administrator
@@OPTIONS AS OPTIONS_SYSTEM
8)@@PACKET_ERRORS : Number of network packet errors since SQL Server was last StartedNumber of network packet errors since SQL Server was last started
@@PACKET_ERRORS AS ERROR_PACKET
9)@@PACK_RECEIVED : Number of network packets received by SQL Server since it was last started
@@PACK_RECEIVED AS RECEIVED_PACKETS
10)@@PACK_SENT : Number of network packets sent by SQL Server since it was last started
@@PACK_SENT AS SENT_PACKETS
In this article we had learned the 10 important global variables which is continuation to global variables part1
Below is the link of my first article on Global variables in Sql Server part -http://www.dotnetfunda.com/articles/article2015-global-variables-in-sql-server-part1.aspx
Found interesting? Add this to: