Click here to Skip to main content
16,011,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two databases on server side (same server), each has different database users. I want to execute a storeprocedure from one database to other database. but it does not allow with out having login.
Posted
Updated 21-Apr-14 0:24am

1 solution

Try this:

SQL
EXECUTE AS user = 'DB User'

EXECUTE SP_Name

REVERT


http://msdn.microsoft.com/en-us/library/ms191296.aspx[^]
 
Share this answer
 
Comments
faizan saand 21-Apr-14 6:34am    
But passward???
faizan saand 21-Apr-14 7:51am    
Cannot execute as the database principal because the principal "ghaffar" does not exist, this type of principal cannot be impersonated, or you do not have permission.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900