views:

258

answers:

1

I have created a test user that has sysadmin right in SQL Server 2005 (sysadmin, because i want to profile with this user name also).But i want to restrict that test users access rights to production database.

It is under "logins" and also db name selected under the "User Mapping" tab of its properties with "db_denydatareader" default schema. But it is still can run select statements.

+1  A: 

Sorry but once you give SysAdmin access, you've given away the farm. You'll have to create a different role for the test user and then grant access only to the databases you want.

Ralph Shillington
But i want to use SQL Profiler with this user account, how can i profile without sysadmin access?
uzay95
grant alter traceor bring up the properties of the Login, and pick securables then set the permissions as required in the effective permissions.Hope that helps.
Ralph Shillington
Alternatively, you could use Windows' 'Run As...' feature to run SQL Profiler as the account with the appropriate rights to run the trace (for instance, the sysadmin account), then run the application or the queries you want to test with your test user.
The Lazy DBA