APIs for monitoring MS-SQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sotriur
    New Member
    • Feb 2007
    • 1

    APIs for monitoring MS-SQL

    hi,
    i want to retrive the information from MS SQL such as
    o Active transactions
    o Average wait time for lock requests
    o Logical Scan – bytes/second
    o Full Scans/Second
    o Lock Blocks
    o Lock Timeouts/second
    o Log Cache Reads/second
    o Log Truncations
    o Logins/second
    o SQL Agent\Failed SQL Agent Jobs
    o SQL Server Backups\Failed SQL Backups
    o SQL Server Replication\Mer ge\Conflicts/second.

    i am searching for API for doing the above said function.
    can anyone help me.
    thanks in advance
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    Not sure if API like this exists but you can definitely use system tables to get all necessary information.

    Some of which you can pool using query like this:

    [PHP]select spid, blocked, loginame,hostna me, program_name,a. status,
    login_time, last_batch, lastwaittype, b.name db_name, waittime/100 waittime
    from master..sysproc esses a
    join master..sysdata bases b on a.dbid = b.dbid [/PHP]

    Comment

    Working...