Is there a drawback to using PRINT in my stored procedures?

I can’t believe that after all these years I ask this question, but ...

Is there a drawback to using PRINT in my stored procedures? I use it for debugging, but should I remove them after completion? I would have preferred it if I hadn't had to.

+6
source share
3 answers

print is a function call that I use only to debug a stored procedure .... it affects performance, but its ver is very minimal cost as a call function .. if it is possible to delete it or comment on it in your code ..

Note : PRINTs in loops that run many thousands of times can cause performance problems.

Also check the re-query question: Should the print statement in the SQL procedure affect performance?

+1
source

If the print statements are also executed in the released version (as opposed to the debug version), this can lead to (very large) performance.

Typically, print instructions are quite expensive, but I know little about stored procedures.

Edit : as others have already confirmed, PRINT is only used as / in debug versions, so there is no real penalty other than a call.

+1
source

It really will not affect, you can leave them if you want.

0
source

Source: https://habr.com/ru/post/908333/


All Articles