May 13, 2003 at 12:22 am
How to run a stored procedure as other user, so I could test his(her) permissions?
May 13, 2003 at 12:24 am
Forgot to say: it is MS SQL 2000 SP3
May 13, 2003 at 5:58 am
If you are using Windows Authentication then you have to log in as that user.
If you are using SQL Authentication then Open SQL Query Analyser and connect to your database using that user's SQL login and password. You can then attempt to run your stored procedure.
Frankly, I would take a completely different approach by using Enterprise Manager.
Are permissions granted to a user (bad idea) or to a role.
What roles does a particular user belong to?
If a user gains access via an NT Group then what role is that group given in SQL Server?
May 13, 2003 at 6:08 am
To login as other user I need to know the password...
May 13, 2003 at 6:18 am
Are you the system administrator?
Get the system administrator to create a copy of that user explicitly for testing.
As I said, this is a long winded approach. Use EM to see who or what has permissions to your stored procedure.
May 13, 2003 at 6:50 am
SETUSER can be used by members of the sysadmin fixed server role to adopt the identity of another user in order to test the permissions of the other user.
Only use SETUSER with SQL Server users. It is not supported with Windows users. When SETUSER has been used to assume the identity of another user, any objects that are created are owned by the user being impersonated.
SETUSER remains in effect until another SETUSER statement is issued or until the current database is changed with the USE statement.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply