March 30, 2016 at 9:00 am
Hi ,
I would like to run a script with a different user from the one I am loggen on my machine as I have no permissions to do it.
I have a windows user account which have the right permissions. how can I run a script in a SQL Server instance using different Windows user?
Thanks.
March 30, 2016 at 10:26 am
You can impersonate another user or login but you need to have been granted impersonate permissions on the user or login first.
EXECUTE AS USER = 'Domain\User'
EXECUTE AS LOGIN= 'Domain\User'
March 30, 2016 at 11:41 am
Another way would be to launch SSMS (or whatever you're using to run you queries) using "Run As" inside of Windows. Right click on the icon.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
March 31, 2016 at 3:05 am
This impersonate needs to be grated where ? On AD side or sql?
March 31, 2016 at 6:17 am
In SQL. See links below for the permissions required and the syntax.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply