Link to home
Start Free TrialLog in
Avatar of Hoboly
Hoboly

asked on

How do I create a new sql server session in entity framework?

How do I create a new sql server session in entity framework?

Thanks~
Avatar of Hoboly
Hoboly

ASKER

All I need is to change @@SSPI
Avatar of Hoboly

ASKER

sorry, All I need is to change @@SPID, not @@SSPI
Avatar of Steve Hogg
Perhaps what you are requesting is not what you really need? What are you trying to accomplish? Multi-threading?
Avatar of Hoboly

ASKER

I am using asp.net mvc + entity framework to make a website.
different users(not domain/windows user) can login.
For each table, there is a trigger. It records every changes.
The trigger uses the @@SPID to distinguish different users.

However, I found that the entity framework re-use the same connection and same session.
so @@SPID cannnot distinguish between users.

ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Hoboly

ASKER

I am using entity framework to update the table directly.
do you mean that I need to pass the username by stored procedure updating the table?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial