MSPSS: is there life after the helpdesk?

sharing solutions to uncommon IT problems

SQL Server: not able to access the database under the current security context

leave a comment »


Hello,

lately I had to find a quick, reliable way to track down some database access failures we were experiencing after we had moved a database from a remote site to our central database server (before it was referenced as linked_server and thus all connections were using the same username).

Several applications reported the following error: “The server principal “username” is not able to access the database “databaseName” under the current security context.”

After a bit of searching I found out that I could use SQL Profiler to log each failure:
In the events section select “User Error Message”.
In the column filter enter “equal to” 916.
Remember to show all columns and make sure that all columns are selected.
Save the output in a table and query it regularly (or you could even set up a insert trigger that sends you an email).

HTH,
Roberto.

Advertisements

Written by zantoro

October 3, 2012 at 12:27 pm

Posted in SQL Server

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: