SQL Functions

Here are the some of the SQL Functions

@@CONNECTIONS - return the number of connections since sql server was started.
@@CPU_BUSY - return the time in milliseconds that the CPU has been actively doing work since sql server was started.
@@CURSOR_ROWS - the number of rows currently in the last cursor set opened on the current connection.
@@DATFIRST - returns the numeric value that corresponds to day of week.
1 -> Monday to 7 -> Sunday
@@DBTS - returns the last used timestamp for the current database.
@@ERROR - Return the error code of the last sql statement
@@IDENTITY - returns the identity value of the last sql insert statement.
@@FETCH_STATUS - return the indicator of the status of the last cursor fetch operation.


Comments

Author: Dotnet Developer-201508 Aug 2009 Member Level: Gold   Points : 1

hi prakash
not working this function sql server 2005
pl change to suitable sql server 2005

Author: Prakash Alamanda08 Aug 2009 Member Level: Gold   Points : 2

Hi Jaya Kumar
sorry i made a mistake for @@DATFIRST
Actually it is @@DATEFIRST
Other than that everything is working for me....
I have sql 2000 and it works perfect and obviously it has to workin sql 2005


select @@CONNECTIONS as Connections,
@@CPU_BUSY as CPU_BUSY,
@@CURSOR_ROWS as CURSOR_ROWS,
@@DATEFIRST as DATE_FRIST,
@@DBTS as DBTS,
@@IDENTITY as IDENTITY_No,
@@ERROR as ERROR,
@@FETCH_STATUS as FETCH_STATUS


OutPut:



17 1 0 7 0x00000000000000C8 NULL 0 0


Do rate this message if it found useful
regards
Prakash Alamanda



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: