June 17, 2005 at 8:54 am
Hello:
This is the message I am getting when I build a string with SQL commands and execute that string with sp_executesql. I have also tried EXEC(
Why I am getting this error message,
Server: Msg 2812, Level 16, State 62, Line 329
Could not find stored procedure 'master..sp_ExecuteSQL'.
I have removed 'master..' before sp_ExecuteSQL and tried, that doesn't work either.
Is there another way that I can get the string with SQL commands executed.
-R
June 17, 2005 at 9:09 am
Can we see the while code?
June 17, 2005 at 9:17 am
Permissions on that proc are set to 'public', so it should work. Can you see it in the master database?
This worked fine when I tested it locally:
declare @sql nvarchar(2000)
set @sql = N'select * from sysusers; exec sp_who;'
exec master..sp_executesql @sql
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply