Showing posts with label encountered. Show all posts
Showing posts with label encountered. Show all posts

Friday, March 30, 2012

Internal Activation - calls stored procs in other DBs

Hi all

I am using internal activation on a queue to process the messages, should an error be encountered I call stored procedure A in the same database to log the error. Part of the processing in stored procedure A is a call to stored procedure B in another database (on the same server), however I have not been able to get this call to B to work. Currently I get the error "The server principal XXXXXX is not able to access the database YYYYYYY under the current security context".

I have tried various combinations (too many to remember) of database owners, roles and permissions as well as EXECUTE AS on both A and B and the Queue but none seem to work. Can anyone give me simple example of a setup which would allow this cross database call to work?

Thanks

Ian

You are hitting the 'Extending database impersonation under EXECUTE AS context' issue. I have a series of posts in my blog tackling this problem:

http://blogs.msdn.com/remusrusanu/archive/2006/03/07/545508.aspx
http://blogs.msdn.com/remusrusanu/archive/2006/03/01/541882.aspx
http://blogs.msdn.com/remusrusanu/archive/2006/01/12/512085.aspx

The first link is posted today and is an actual example on how to call a procedure in another database under activation.

|||

Thanks for the information - it's just what I was looking for.

Ian

|||

One more question....

Is it essential that the owner of the other DB is the same as the owner of the activated stored proc?

I don't seem to be able to get this to work if they are different.

Thanks

Ian

|||You can use any user with receive permission on the queue.|||I think you must grant AUTHENTICATE permission on the 'other' DB to the user from the EXECUTE AS clause of the CREATE/ALTER procedure. If the EXECUTE AS is OWNER, then to the owner of the activated procedure)

Friday, March 9, 2012

Integrity Checks job causing SQL 7 database to enter single-user mode

Hi,
I've encountered with very strange problem on this issue on one of my my SQL 7 Servers.
The integrity checks job on the database failed, and caused the database to enter the single user mode, thus preventing applications to access the database. I had to manually switch the database to normal mode to repair the problem.
Right now, every time i try to run the integrity checks job, it fails and causes the database to enter the single user mode again.
Any ideas how to solve the problem?
Thanks in advance,
BarakThis looks like a known issue. Have you seen this?
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B259551
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
What hardware is your SQL Server running on?
http://vyaskn.tripod.com/poll.htm
"Barak Turovsky" <barak.turovsky@.comverse.com> wrote in message
news:7DA294DF-065F-431A-91D6-AA23B4AA50CE@.microsoft.com...
Hi,
I've encountered with very strange problem on this issue on one of my my SQL
7 Servers.
The integrity checks job on the database failed, and caused the database to
enter the single user mode, thus preventing applications to access the
database. I had to manually switch the database to normal mode to repair the
problem.
Right now, every time i try to run the integrity checks job, it fails and
causes the database to enter the single user mode again.
Any ideas how to solve the problem?
Thanks in advance,
Barak