Web Design Forums

Other Languages

Get help with any programming languages other than the ones above.

Nifty SQL Server @@ Properties



Site of the Month Voting - Now Open. CAST YOUR VOTE NOW!

Reply
 
LinkBack Thread Tools
Old March 28 '03, 03:22 PM (#1)
smoseley is online now
WDF Moderator
 
smoseley's Avatar
 
Join Date: March 2003
Location: Miami, FL
Posts: 8,719
smoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud of
Nifty SQL Server @@ Properties

Some useful SQL Server Properties:
  • @@CONNECTIONS - Returns the number of connections, or attempted connections, since Microsoft® SQL Server™ was last started.
  • @@MAX_CONNECTIONS - Returns the maximum number of simultaneous user connections allowed on a Microsoft® SQL Server™.
  • @@CPU_BUSY - Returns the time in milliseconds (based on the resolution of the system timer) that the CPU has spent working since Microsoft® SQL Server™ was last started.
  • @@CURSOR_ROWS - Returns the number of qualifying rows currently in the last cursor opened on the connection.
  • @@DBTS - Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database.
  • @@ERROR - Returns the error number for the last Transact-SQL statement executed.
  • @@TOTAL_ERRORS - Returns the number of disk read/write errors encountered by Microsoft® SQL Server™ since last started.
  • @@FETCH_STATUS - Returns the status of the last cursor FETCH statement issued against any cursor currently opened by the connection.
  • @@IDENTITY - Returns the last-inserted identity value.
  • @@LANGID - Returns the local language identifier (ID) of the language currently in use.
  • @@LANGUAGE - Returns the name of the language currently in use.
  • @@REMSERVER - Returns the name of the remote Microsoft® SQL Server™ database server as it appears in the login record.
  • @@SERVERNAME - Returns the name of the local server running Microsoft® SQL Server™.
  • @@VERSION - Returns the date, version, and processor type for the current installation of Microsoft® SQL Server™.

Use them like this:
Code:
SELECT @@IDENTITY AS id
There are also many useful built-in Stored Procedures, like:
  • sp_helpdb - Reports information (name, db_size, owner, dbid, created, status) about a specified database or all databases.
  • sp_helplogins - Provides information about logins and the associated users in each database.

Use them like this:
Code:
EXEC sp_helpdb
GO
EXEC sp_help_logins('sa')
GO
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » Other Languages

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server Design Question (?) dinologic Database Systems Help 8 April 17 '09 12:01 PM
ASP.NET connecting to SQL Server 2005 bfsog Other Languages 2 July 24 '08 02:13 PM
IS.nl (Interned Services - Netherlands) TheGAME1264 Server Administration Help 6 June 3 '04 10:46 AM
SQL Server 2000 backups to a client machine that doesn't have SQL Server TheGAME1264 Database Systems Help 21 August 11 '03 01:34 AM
Locating SQL Server info through a DSN TheGAME1264 Database Systems Help 21 March 28 '03 03:17 PM

 
User Infomation
Your Avatar

Site Of The Month
Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 01:57 PM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164