Need to know which user is calling which proc and SQL Server.

  • Hi everybody, can some one give me a stored procedure or any thing which can help me to get .

    Thanks

  • Hi,

    select @@servername

    Will return the name of the current server.

    Cheers,

    John

  • Use the 2 DMVs sys.dm_exec_requests and sys.dm_exec_sessions to see details of who is running queries against the server. You can join in the function sys.dm_exec_sql_text to get the details of what they are running. (the function gives the full create script of a procedure if the user is running the pocedure.

    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
  • Using Profiler, it is possible to get which user is calling which stored procedure from which host.

  • use sp_who or sp_who2 active

  • Thanks Shaw, but these are almost same like sysprocesses in sql2000 system table , i can use these two above views in sql2005 only.

    Can you give me some thing for sql2000 please.

  • You can use dbcc inputbuffer (spid) for SQL 2000.

Viewing 7 posts - 1 through 6 (of 6 total)

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