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.
| Author |
Topic |
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2008-04-15 : 12:26:05
|
I have two instances running on a machine...The following code will run on the named instance but not on the default instance.On the default instance I get the following error:Cannot execute as the user 'SA', because it does not exist or you do not have permission.However if I specify another account it does work.use dbReportgoDROP procedure dbo.clarktestGOcreate procedure dbo.clarktestWITH EXECUTE AS 'SA' -- 'Domain\SqlCmdShellDev'asEXEC xp_cmdshell 'dir'gogrant exec on clarktest to [spexec]exec clarktestuse mastergoAny assistance is appreciated as the developers code needs to be coded generically i.e. "sa" this is to prevent code manipulation during migrations... Thank you You can do anything at www.zombo.com |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-04-15 : 13:15:52
|
| do you have SA login created?_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2008-04-15 : 13:21:55
|
Yes sa is created adn sql & nt auth is enabled You can do anything at www.zombo.com |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-04-15 : 13:22:47
|
| what permissions does the user you log in with have?_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2008-04-15 : 13:28:00
|
I am currently testing with my account... NT, sysadmin You can do anything at www.zombo.com |
 |
|
|
|
|
|