Appear in Online Interview to test your skills and be ready for job!
Twitter Twitter LinkedIn YouTube Google
Be Interview ready ! | Search
Make friends on DotNetFunda.com and expand your network!
Winners

Win Prizes

Announcements
Like us on Facebook
Sponsor
Top Articles Author
Thu, 24-Apr-2014 Authors
All Time Authors
Sourav.Kayal
39750
Sheonarayan
34800
Niladri.Biswas
33350

Latest members | More ...


(Statistics delayed by 5 minutes)
Ads

Global Variables in SQL Server - Part2

Saratvaddilli
Posted by under Sql Server category on for Beginner level | Points: 250 | Views : 2296 red flag
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

Introduction

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.

   Example

 

select

@@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.

   Example

select

@@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.

   Example

select

@@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 connections''.

   Example

select

@@MAX_CONNECTIONS AS MAXIMUMCONNECTIONS

5)@@MAX_PRECISION         : Maximum precision allowed for decimal and numeric data types

   Example

select

@@MAX_PRECISION PRECISION_ALLOWED

6)@@NESTLEVEL                    : The current level of stored procedure nesting. If there are no currently executing nested procedures then this variable is zero

   Example 

select

@@NESTLEVEL AS

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

   Example

select

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

   Example

select

@@PACKET_ERRORS AS ERROR_PACKET

9)@@PACK_RECEIVED               : Number of network packets received by SQL Server since it was last started

   Example

select

@@PACK_RECEIVED AS RECEIVED_PACKETS

10)@@PACK_SENT                     : Number of network packets sent by SQL Server since it was last started

   Example

select

@@PACK_SENT AS SENT_PACKETS

Conclusion

 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

Reference

 http://manuals.sybase.com/onlinebooks/group-asarc/srg1100e/sqlref/@Generic__BookTextView/72481;pt=73386
            
Page copy protected against web site content infringement by Copyscape
Found interesting? Add this to:




About the Author

Saratvaddilli

Full Name: vaddilli sarat
Member Level: Bronze
Member Status: Member
Member Since: 7/30/2012 3:54:23 AM
Country: India
Thanks and Regards V.SaratChand Show difficulties that how difficult you are
www.dotnetfunda.com

I am sarat vaddilli working on the cutting edge technologies like html5,css3, Jquery and MicroSoft technologies like Asp.Net,Asp.Net MVC, SQL Server.
Login to vote for this post.

Comments or Responses


Login to post response.

Comments / Responses
Select text & click toolbar to format. Formatting appears in viewmode only. HTML Tags are not allowed.
Bold Italic Underline Paragraph Title Code  Link 
 Wait ... Processing ..... please wait.

Comment using Facebook