Home > Archive > MS SQL Server > October 2005 > user Associated with a pid









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author user Associated with a pid
nsajus@yahoo.com

2005-10-28, 8:23 pm

Hi,

I need some information regarding obtaining the user associated with a
pid/process in the Sql Sever. I am trying to create a trigger on Delete
on one of the tables in a database.. Is it possible to get the user
associated with the process(pid) who is deleting rows from a table in
that trigger?

Any help will be appreciated.

Thanks,
Ann

David Gugick

2005-10-28, 8:23 pm

nsajus@yahoo.com wrote:
> Hi,
>
> I need some information regarding obtaining the user associated with a
> pid/process in the Sql Sever. I am trying to create a trigger on
> Delete on one of the tables in a database.. Is it possible to get the
> user associated with the process(pid) who is deleting rows from a
> table in that trigger?
>
> Any help will be appreciated.
>
> Thanks,
> Ann


Try SUSER_SNAME()

--
David Gugick
Quest Software
www.imceda.com
www.quest.com

Erland Sommarskog

2005-10-28, 8:23 pm

(nsajus@yahoo.com) writes:
> I need some information regarding obtaining the user associated with a
> pid/process in the Sql Sever. I am trying to create a trigger on Delete
> on one of the tables in a database.. Is it possible to get the user
> associated with the process(pid) who is deleting rows from a table in
> that trigger?


USER give the user name within the database.
SYSTEM_USER gives the login name in SQL Server.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

nsajus@yahoo.com

2005-10-31, 9:23 am

Thanks every one..Really appreciate it!

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com