2014-11-04 64 views
0

SQL Server 2008 R2中有一個奇怪的錯誤。服務器主體****無法在當前安全環境下訪問****數據庫

我映射爲db_owner的myDB

但是,當我登錄到SQL Server,並試圖展開數據庫選項卡,我得到這個錯誤:

The server principal "myLocalUser" is not able to access the database "anotherDB" under the current security context

錯誤是指另一個數據庫 ...

我不知道爲什麼它嘗試連接「另一個數據庫」。

雖然我不使用它,但獲得「另一個數據庫」權限後,該錯誤得到修復。

感謝您的幫助。

+0

'myDB'中是否有指向'anotherDB'中的對象的任何同義詞? – 2014-11-04 07:38:29

+0

我不認爲....我知道db很好,不需要另一個數據庫... 我該如何檢查它? – Efrat 2014-11-04 07:56:05

+0

也許這將有助於:http://www.orcsweb.com/blog/desiree/the-server-principal-a-is-not-able-to-access-the-database-b-under-the-current- security-context-microsoft-sql-server-error-916/ – 2014-11-04 08:38:05

回答

0

啓動一個探查器,爲其「另一個數據庫」和「myLocalUser」添加一個過濾器,並且您一定會看到該冒犯性聲明是什麼。

+0

但是在我啓動應用程序之前發生了......未經許可的情況下,引用myDB的應用程序運行良好。 – Efrat 2014-11-05 07:14:37

+0

我的聲明表明。啓動分析器並查看發生了什麼。 – 2014-11-05 12:36:14

相關問題