Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Login ID - need some ideas
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

GustiX
Starting Member

Iceland
28 Posts

Posted - 10/16/2012 :  03:45:05  Show Profile  Reply with Quote
Hi,

We have an application that manipulates data in SQL server
I have made some "audit" triggers that monitor what data is
being changed but I need to know WHO is changing it.

This application has a user login (user info and passw is stored id db)
which I somehow need to be able to access from within the database triggers.
(This login is not a sql srv. or windows login.)

Can I somehow set like a session variable with this user id which will
be only valid for the session I am working on?

Ideas?

bandi
Flowing Fount of Yak Knowledge

India
2242 Posts

Posted - 10/16/2012 :  03:53:25  Show Profile  Reply with Quote
To know the current windows login:

check this link
http://blog.sqlauthority.com/2009/05/26/sql-server-find-hostname-and-current-logged-in-user-name/

--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000