Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How do I run an SP as a Different User?

Author  Topic 

mikebird
Aged Yak Warrior

529 Posts

Posted - 2008-09-26 : 11:01:07
I ran an SP as myself and terrible things happened - tables created as me, not DBO! Everything stopped working! Had to drop the tables...

I need to do this not manually. Procedure needs to run as DBO, as it always did. How do I set that?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-26 : 11:24:31
use EXECUTE AS option

http://msdn.microsoft.com/en-us/library/ms178106.aspx
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-09-26 : 11:25:46
How did you run as yourself? Is the owner dbo for that SP?
Go to Top of Page
   

- Advertisement -