Who Ran Queries SQL 2008

  • This is a script to find out what and who is running queries currently...

    Select spid,hostname,program_name,nt_username,loginame,cmd, t.text from sys.sysprocesses

    CROSS APPLY( select text from sys.dm_exec_sql_text(sql_handle))t

    Is there something to find out all the queries that ran with USER logins in the past... I am using SQL 2008.

    THanks,

    Laura.

  • No. SQL doesn't keep track of that. You can use SQLAudit (I think) or a trace for that kind of information.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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