[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

sl0703

3/15/2007 6:16:00 PM

My objective is to register the Windows-LogonID in audit trail, but at
this point the application is using a SQL-userID. From searching this
group, it seems impossible to get the Windows-ID as a variable in the
SQL server if connected with SQL-userID - so I'm trying to find
alternative.

Question: Is it possible to pass a variable via the connection string
that could be read by triggers/stored-procedures on the server during
that connection?

Or does anyone have and idea how to resolve this objective, while
keeping the connection via SQL-login?

Thanks, Shraga

2 Answers

Tibor Karaszi

3/15/2007 8:31:00 PM

0

How about SET CONTEXT_INFO?

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/d...
http://sqlblog.com/blogs/tib...


<sl0703@gmail.com> wrote in message news:1173982561.814109.126070@l75g2000hse.googlegroups.com...
> My objective is to register the Windows-LogonID in audit trail, but at
> this point the application is using a SQL-userID. From searching this
> group, it seems impossible to get the Windows-ID as a variable in the
> SQL server if connected with SQL-userID - so I'm trying to find
> alternative.
>
> Question: Is it possible to pass a variable via the connection string
> that could be read by triggers/stored-procedures on the server during
> that connection?
>
> Or does anyone have and idea how to resolve this objective, while
> keeping the connection via SQL-login?
>
> Thanks, Shraga
>

brattn

3/15/2007 10:01:00 PM

0

You can use the "Application Name" or "APP" of the Connection string
and in sql use the APP_NAME() system function to get the value.

http://msdn2.microsoft.com/en-us/library/ms1...



On Mar 15, 12:16 pm, sl0...@gmail.com wrote:
> My objective is to register the Windows-LogonID in audit trail, but at
> this point the application is using a SQL-userID. From searching this
> group, it seems impossible to get the Windows-ID as a variable in the
> SQL server if connected with SQL-userID - so I'm trying to find
> alternative.
>
> Question: Is it possible to pass a variable via the connection string
> that could be read by triggers/stored-procedures on the server during
> that connection?
>
> Or does anyone have and idea how to resolve this objective, while
> keeping the connection via SQL-login?
>
> Thanks, Shraga