SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 
        
Home       Members    Calendar    Who's On



Issues with security context Expand / Collapse
Author
Message
Posted Wednesday, November 04, 2009 9:39 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 11:25 AM
Points: 136, Visits: 186
In proc, current loggin is impersonated to "somedb-admin" to access objects in other db. So when the procs are called from asp.net, one proc tries to access objects from another data base by impersonation from "sa" to "somedb-admin" and we get this error.

The server principal "somedb-admin" is not able to access the database "CAA" under the current security context.

Recently db was restored from live to test and data base ids were also corrected. we have also executed EXEC sp_change_users_login 'Report'; to know orphan users, but nothing was returned.


cheers
Siddarth
Post #813684
Posted Wednesday, November 04, 2009 10:30 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:48 PM
Points: 10,000, Visits: 9,828
Am I reading your post correctly? You are using the sa account to access your database from a web server?



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #813723
Posted Wednesday, November 04, 2009 10:57 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 11:25 AM
Points: 136, Visits: 186
we use "some-sa" account for logging on to db server in connection string in asp.net web application.

cheers
Post #813736
Posted Friday, November 06, 2009 4:15 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 11:25 AM
Points: 136, Visits: 186
the issue is sorted. On one data base trusworty was set to on and on another data base it was set automatically to off when data base was restored from live. so when user was impersonated, the error came. this is very strange.

We altered the data base and set trustworty on.

cheers
Siddarth
Post #814812
« Prev Topic | Next Topic »


Permissions Expand / Collapse