Friday, June 22, 2018

Loss of database access in SQL

I administer several SQL Server instances.  To connect to these I use my domain account which has Sysadmin privilege on each server.

Last night when I logged in to perform some updates I was greeted with the "server principal is not able to access the database under the current security context" message.  This was to a SQL 2012 server, again with my domain account.

Not only is my domain account a Sysadmin but I'm also a local admin on the server.  I was able to access the server just fine using SA.  I am also able to access other servers fine with my domain account.  Just this one SQL 2012 instance was giving me trouble.

This morning I've been searching the heck out of this and testing all kinds of things.  I was able to create a SQL user and give it Sysadmin and access all the databases just fine.

Finally I tried to take away and give back Sysadmin to my user - that didn't work.

What did work was dropping my user altogether, then adding it back and granting it Sysadmin again.  All seems well now.

Simply inexplicable!

No comments:

Post a Comment