how to know which applicaton is using our sql server

  • boys,

    does anyone know how to see which application is using our sql server

    thanks

  • There are many ways to determine what sessions are connected to a SQL Server and their may or may not be any helpful information that would determine the application the session was created for. The activity monitor or sp_who2 for example will give you quite a bit information about who is connected to your SQL server however if you are looking to simply determine what applications could be connecting at any given time then there is nothing that would point to a given app.

    Dan

    If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.

  • Read this SSC article on running the default trace. Default trace - A Beginner's Guide

    By Adam Haines,

    http://www.sqlservercentral.com/articles/SQL+Server+2005/64547/

    In it you will find code that will return the application name.

    Here is a sample of the code that will display the application name.

    **Make sure to use your trace file path below. Yours may be different than mine.

    SELECT loginname,loginsid,spid,hostname,applicationname,servername,databasename,objectName,

    e.category_id, cat.name as [CategoryName],textdata,starttime,eventclass, eventsubclass,--0=begin,1=commit

    e.name as EventName

    FROM ::fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log.trc',0)

    INNER JOIN sys.trace_events e ON eventclass = trace_event_id

    INNER JOIN sys.trace_categories AS cat ON e.category_id = cat.category_id

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply