From: Greg on 15 Jan 2010 15:10
This is not entirely true. You can log in with your current
integrated security credentials and then impersonate another login
(sql server or domain login) within SQL Server.
First, go into sql server security folder and select your domain login
Within the Properties dialog, select Securables and then select Add...
Within the "Add Objects" dialog select specific objects and OK...
Within the "Select Objects" dialog click Object Types...
Within the 'Select Object Types" dialog select "Logins" and then OK...
Back in the "Select Objects" dialog click Browse....
Within the "Browse for Objects" dialog, select the other Domain user
you want to impersonate and click OK
Back in the "Select Objects" dialog click OK...
Back in the "Login Properties" dialog, select the Grant option for
Impersonate and click OK.
All that clicking around could be accomplished by this single line of
GRANT IMPERSONATE ON LOGIN::[<domain user 2>] TO [<domain user 1>]
Now, simply login to sql using your domain account and run the
EXECUTE AS LOGIN = '<domain user 2>'
All subsequent TSQL commands in that session will be executed under
the <domain user 2> context.
To swtich back to your own context within that session, use the revert
....Now to what I was searching for...a way to execute the command
"EXECUTE AS LOGIN = '<domain user 2>'" automatically when domain user
1 logs in....any ideas???
First | Prev |
Pages: 1 2
Prev: Help with sql query
Next: Can I do this? invoke function with parameter from join table