Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,730
    Member #
    819
    Liked
    202 times
    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

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:02 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com