D
d0wsdkn02
I have an ASP.NET application that performs ADO.NET commands that cause
triggers to be run in SQL Server 2000.
My question is how would I best access the user ID from my custom .NET
Principal in the trigger (the trigger stores audit information and
needs the user ID)?
I'm using the same SQL Server user/pass on every connection to
facilitate connection pooling, so it's not available that way.
I've seen references to using SQL Server's CONTEXT_INFO or creating a
table to hold session data. I could also do something like this:
"set @userid='bob'; insert into customer values (1,2,3);"
but I'm not sure how to access that userid variable from the trigger
that will be fired.
Any advice would be appreciated. Thanks!
triggers to be run in SQL Server 2000.
My question is how would I best access the user ID from my custom .NET
Principal in the trigger (the trigger stores audit information and
needs the user ID)?
I'm using the same SQL Server user/pass on every connection to
facilitate connection pooling, so it's not available that way.
I've seen references to using SQL Server's CONTEXT_INFO or creating a
table to hold session data. I could also do something like this:
"set @userid='bob'; insert into customer values (1,2,3);"
but I'm not sure how to access that userid variable from the trigger
that will be fired.
Any advice would be appreciated. Thanks!