Hi,
I am running into an issue that I really need resolved today. Simply put, I
am getting the error:
The server principal "dhtest" is not able to access the database "dhtest2"
under the current security context. (Microsoft SQL Server, Error: 916)
But, the details are a little fuzzy...
I have two installations of SQL Server 2008 RC0.
Microsoft SQL Server 2008 (CTP) Enterprise Edition (64-bit) CTP is installed
on one server running Windows Server 2008 x64.
And, Microsoft SQL Server 2008 (CTP) Enterprise Edition CTP is installed on
the other server running Windows Server 2003.
Both were installed with the same installation options (the SQL services are
all running using a local admin account).
I created two databases on the x64 server:
db: dhtest
user: dhtest with dbo permission dhtest
db: dhtest2
user: dhtest2 with dbo permissions to dhtest2
I then try connecting via sql server management studio using SQL
authentication and get this error:
The server principal "dhtest" is not able to access the database "dhtest2"
under the current security context. (Microsoft SQL Server, Error: 916)
But . . . I can connect to the x64 server from the server running Windows
Server 2003 with SQL server management studio just fine. No errors at all
and I have access to the assigned database as expected.
I also tested connecting from the x64 server to the Windows server 2003 with
sql management studio and got the same error.
So... it appears to be a security setting ont the x64 box.
In event viewer I see the errors below but it doesn't make sense because the
Windows Firewall is turned off.
The Windows Filtering Platform has blocked a bind to a local port.
Application Name: \device\harddiskvolume1\windows\system32\svchost.exe
Network Information:
Source Address: 0.0.0.0
Source Port: 59535
Protocol: 17
*********************
Process ID: 240
Application Name: \device\harddiskvolume2\program files (x86)\microsoft sql
server\100\tools\binn\vsshell\common7\ide\ssms.exe
If anyone has any suggestions at all, I would greatly appreciate it.
Desiree
Ekrem Önsoy - 30 Jun 2008 17:44 GMT
I haven't installed Windows Server 2008 yet (what a shame...)
However the thing in my mind is that there could be some UAC system just
like in Windows Vista. So, try right clicking on the SSMS and choose "Run as
Administrator" to run this tool. Then your problem may be solved.

Signature
Ekrem Önsoy
> Hi,
>
[quoted text clipped - 55 lines]
>
> Desiree
Desiree Harris - 30 Jun 2008 18:05 GMT
Hi,
Thank you for your response, but that didn't work. :( I selected to run as
administrator, but then I connect using SQL authentication (as this is how
our users will connect) and it fails with the same error. Any other ideas?
By the way, it's similar to the issue reported here -
(http://community.discountasp.net/default.aspx?f=16&m=25479) Installing the
hotfixes didn't help though.
Desiree
>I haven't installed Windows Server 2008 yet (what a shame...)
>
[quoted text clipped - 63 lines]
>>
>> Desiree
Erland Sommarskog - 01 Jul 2008 23:28 GMT
> I created two databases on the x64 server:
>
[quoted text clipped - 9 lines]
> The server principal "dhtest" is not able to access the database "dhtest2"
> under the current security context. (Microsoft SQL Server, Error: 916)
Did you by chance set up a login trigger? The error message is one you
usally get when you use EXECUTE AS USER, and the database is not set to
trustworthy,

Signature
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Desiree Harris - 02 Jul 2008 19:55 GMT
Hi,
I was able to get this resolved - I wrote a blog about it for anyone that
may run into the same issue - http://blogs.orcsweb.com/desiree/default.aspx
Thanks!
Desiree
>> I created two databases on the x64 server:
>>
[quoted text clipped - 14 lines]
> usally get when you use EXECUTE AS USER, and the database is not set to
> trustworthy,
Ekrem Önsoy - 02 Jul 2008 21:31 GMT
I've read your blog now. Is your SQL Login a member of the sysadmin role?
This sounds like a bug of SSMS.

Signature
Ekrem Önsoy
> Hi,
>
[quoted text clipped - 23 lines]
>> usally get when you use EXECUTE AS USER, and the database is not set to
>> trustworthy,
Desiree Harris - 02 Jul 2008 22:18 GMT
Hi,
It is definitely a bug. ;) The sql login is in the public role and has dbo
permissions to one database on the server (dhtest). (it also has the default
database set to the appropriate database (in this case dhtest)).
I hope that helps.
Desiree
> I've read your blog now. Is your SQL Login a member of the sysadmin role?
>
[quoted text clipped - 27 lines]
>>> usally get when you use EXECUTE AS USER, and the database is not set to
>>> trustworthy,