January 30, 2008 at 7:31 am
I have a stored procedure that has several statements like print 'This is the result'
These statements are causing errors with other stored procedures that call it. I'm not permitted to modify the stored procedure that has the problem since it is part of a base product. Is there a way to turn off print so that when I call the stored procedure that has the print command, it doesn't print anything.
Thanks.
January 30, 2008 at 7:39 am
I've never heard of anything that'll help. You'll either have to modify the procedure to disable the PRINT statements or you have to modify the code so that it can accept the informational messages along with result sets.
"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
January 30, 2008 at 7:51 am
I'd say that you should wrap them in an IF clause, but if you can't add a parameter or logic, that might not help.
Are the print statements used? If not, I'd comment them out and alter the proc so they don't execute.
AFAIK, there's no way to prevent them if they're in code.
January 30, 2008 at 8:01 am
Yeah, the stored procedure can't be modified. It looks like the solution here may be to just copy the stored procedure without the print statements into another new proc. Thanks...
January 31, 2008 at 10:55 am
Interesting; I'd like to know how a PRINT statement affects the other procedures;I haven;t tripped over that yet, and do a lot of programming.
Can you explain what goes wrong?
Another idea: Could it be that your confusing print statement issues with "x Rows Affected" statements, which I know can mess up ADODB recordsets (that gets fixed easily by simply adding SET NOCOUNT ON at the top of each of the procedures )
Lowell
November 4, 2011 at 1:26 pm
Yes, Lowell
That is the problem. I need to disable the outputs like the ones you specified.
Regards,
Sid
November 4, 2011 at 2:57 pm
siddharth.malhotra (11/4/2011)
Yes, LowellThat is the problem. I need to disable the outputs like the ones you specified.
Regards,
Sid
Did you try putting SET NOCOUNT ON before the stored procedure is executed?
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply