.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> SQL Query >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Some new queries about sql server

Posted By:Nikhil Kumar       Posted Date: February 27, 2010    Points: 10    Category: SQL Query    URL: http://www.dotnetspark.com  

These lines of code showing you some new queries about sql Server.
 

/* TO SEE THE CONNECTION NAME */
SELECT @@SERVERNAME AS 'SERVER NAME'


/*The following example shows returning the number of login attempts as of the current date and 
time.*/
SELECT GETDATE() AS 'Today''s Date and Time', 
@@CONNECTIONS AS 'Login Attempts'


/*The following example shows the last-stamp value of the current database */
SELECT @@DBTS AS 'LAST TIME USED DATABASE'


/*The following example shows the current session language */
select @@language as'lang'


/*The following example shows the total connection */
select @@Max_connections as 'maximum connection'


/*The following example shows the total error are generated today on a particular database  */

SELECT @@TOTAL_ERRORS AS 'Errors', GETDATE() AS 'As of'


/* The following example shows the total read and write as of the current date and time*/
SELECT @@TOTAL_READ AS 'Reads', @@TOTAL_WRITE AS 'Writes', GETDATE() AS 'As of'


/*The following example shows the version of the current sql server */
Select @@version as 'Sql version'

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend