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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to pass web user to sql server trigger
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shah.syedarif
Starting Member

2 Posts

Posted - 07/28/2013 :  05:52:14  Show Profile  Reply with Quote
Hi,

I have created a trigger to audit changes to table rows from my web application. My web application is using a single db user to do updates to the database. However, many different users can log in to the website and do the updates and inserts. Therefore, the db user will always be same but web users will be different

I want to have some way to capture the logged in user to the website who is making the changes to the rows so that I can audit the changes along with the web user that is making the changes.

Can someone please guide me how can I capture the web session in my sql trigger so that I know who is making the changes. Can I configure the web.config file so that the session info is also passed on to the sql server trigger or if there is some other way, please let me know

Regards

Arif

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2039 Posts

Posted - 07/29/2013 :  03:26:55  Show Profile  Visit jackv's Homepage  Reply with Quote
If you created another column either in the data table(s) or an audit table, and passed in the web user value - then you could save the information. Therefore treating the web user value like any other value.



Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

shah.syedarif
Starting Member

2 Posts

Posted - 07/29/2013 :  06:48:48  Show Profile  Reply with Quote
Hi,

Is there anyway to get the user information from web session without having to explicitly pass the user information? I read somewhere that we could use context_info, or app_name etc..but I dont know how to use these.
Go to Top of Page

mianasad111
Starting Member

Pakistan
1 Posts

Posted - 08/01/2013 :  03:52:47  Show Profile  Reply with Quote
I am extremely impressed with your writing skills and also with the layout on your blog. [url=http://www.rozee4all.com/]Saudi Arabia Jobs[/url]Is this a paid theme or did you customize it yourself? Either way keep up the nice quality writing, [url=http://www.rozee4all.com/]Jobs Portal[/url] it’s rare to see a nice blog like this one these days
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.31 seconds. Powered By: Snitz Forums 2000