This one has me stumped
-
I'm at the last stage of a complete overhaul of our build scripts and I'm down to one last issue. I can't seem to use sqlcmd to execute a create procedure statement that has a raiserror command in it. sqlcmd pre parses out the command and fails without executing. There doesn't seem to be any documented escape that I can figure out.
Curvature of the Mind now with 3D
-
I'm at the last stage of a complete overhaul of our build scripts and I'm down to one last issue. I can't seem to use sqlcmd to execute a create procedure statement that has a raiserror command in it. sqlcmd pre parses out the command and fails without executing. There doesn't seem to be any documented escape that I can figure out.
Curvature of the Mind now with 3D
Just made a test with this and didn't have any problems. Could it be that you're having problems with for example apostrophes in the script in the RAISERROR statement. The test script I used was:
create procedure ptest as
begin
raiserror( 'message', 10, 10 );
end;
goand the command:
sqlcmd -S .\instancename -E -d dbname -i testproc.txt
Could you post the error message and the part of the script that's causing problems. Also have a test drive with the script above to see if it also causes the same problem.
The need to optimize rises from a bad design.My articles[^]