BISQL # 81 – SQL Server Global Variable #3 – Global Variable 24 of 36 – Detailed explanation and Example
Hello friends,
Lets continue from my last post in series of Global variable
- SQL Server Global Variable #1 – Introduction of Global Variable
- SQL Server Global Variable #2 – Global Variable 12 of 36
- SQL Server Global Variable #3 – Global Variable 24 of 36 (This post)
- SQL Server Global Variable #4 – Global Variable 36 of 36
- SQL Server Global Variable #5 – Summery of SQL Server Global Variable
In this Article we are going to cover
- @@PACKET_ERRORS
- @@ROWCOUNT
- @@SERVERNAME
- @@SPID
- @@TEXTSIZE
- @@TIMETICKS
- @@TOTAL_ERRORS
- @@TOTAL_READ
- @@TOTAL_WRITE
- @@TRANCOUNT
- @@VERSION
- @@CURSOR_ROWS
Global variable are most used variable in SQL Server as these are One of the important aspect and needed at various stages of development.
Lets see next 12 Global Variable …
@@PACKET_ERRORS
This Global variable returns the number of network packet errors that have occurred on SQL Server connections since SQL Server was last started.
Help Script
SELECT @@PACKET_ERRORS AS '@@PACKET_ERRORS is the number of network packet errors'
Output
@@ROWCOUNT
This Global variable returns the number of rows affected by the last statement.
Help Script
SELECT @@ROWCOUNT AS '@@ROWCOUNT is the number of rows affected by the last statement'
Output
@@SERVERNAME
This Global variable returns the name of the local server that is running SQL Server.
Help Script
SELECT @@SERVERNAME AS '@@SERVERNAME is name of the local server'
Output
@@SPID
This Global variable returns the session ID of the current user process
Help Script
SELECT @@SPID AS '@@SPID identify the current user process in the output'
Output
@@TEXTSIZE
This Global variable returns the current value of the TEXTSIZE option
Help Script
SELECT @@TEXTSIZE AS '@@TEXTSIZE is current value of the TEXTSIZE option'
Output
@@TIMETICKS
This Global variable returns the number of microseconds per tick.
The amount of time per tick is computer-dependent.
Each tick on the operating system is 31.25 milliseconds, or one thirty-second of a second
Help Script
SELECT @@TIMETICKS AS '@@TIMETICKS is the number of microseconds per tick'
Output
@@TOTAL_ERRORS
This Global variable returns the number of disk write errors encountered by SQL Server since SQL Server last started.
Help Script
SELECT @@TOTAL_ERRORS AS '@@TOTAL_ERRORS is the number of disk write errors'
Output
@@TOTAL_READ
This Global variable returns the number of disk reads, not cache reads, by SQL Server since SQL Server was last started.
Help Script
SELECT @@TOTAL_READ AS '@@TOTAL_READ is the number of disk reads'
Output
@@SERVICENAME
This Global variable returns the name of the registry key under which SQL Server is running
Help Script
SELECT @@SERVICENAME AS '@@SERVICENAME Gives name of the registry key'
Output
@@TOTAL_WRITE
This Global variable returns the number of disk writes by SQL Server since SQL Server was last started
Help Script
SELECT @@TOTAL_WRITE AS '@@TOTAL_WRITE is the number of disk writes'
Output
@@TRANCOUNT
This Global variable returns the number of active transactions for the current connection.
Help Script
SELECT @@TRANCOUNT AS '@@TRANCOUNT is the number of active transactions for the current connection'
Output
@@VERSION
This Global variable returns version, processor architecture, build date, and operating system for the current installation of SQL Server.
Help Script
SELECT @@VERSION AS '@@VERSION is Version details'
Output
@@CURSOR_ROWS
This Global variable returns the number of qualifying rows currently in the last cursor opened on the connection
Help Script
SELECT @@CURSOR_ROWS AS '@@CURSOR_ROWS is the number of qualifying rows currently'
Output
Hope this Helps !!!!
Thanks for visiting my blog !!
Hope you will like this post on Details of 12 Global Variable and explanation with example.
If you really like reading my blog and understood at lest few thing then please don’t forget to subscribe my blog .
If you wan daily link and analysis or interesting link go to following website which will give @ your inbox please subscribe our following link resource blog
Where todays links are