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

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Connection level variable for trigger use possible

Author  Topic 

gman6
Starting Member

4 Posts

Posted - 2008-05-19 : 11:24:00
I need to pass a application userid on every call to my database for triggers on the db to use.

I am connecting to my database using integrated security from my application, all on one windows domain account. However I need to get an application user id over on the connection for triggers to use to stamp in changelogs.

Currently everytime we open a connection we create a #table with the user id in it, but that is expensive, especially in our new SOA where connections are frequently created and dropped on requests.

Is there any way I can get a connection level variable over to the database server so triggers could read it?

Any help is greatly appreciated.
   

- Advertisement -