I noticed in a code review that one developer added PRINT statements throughout many SQL Server stored procedures.
These stored procedures are executed from a ASP.NET website, using 开发者_运维技巧SqlClient.
Is there any performance penalty to having these PRINT statement in the code? Or will they automatically be skipped when the procs are called from Sql Client via ASP.NET?
I'm running Sql Server 2005.
As noted here, "when using the SqlClient provider...messages do not alter control flow and can be intercepted by application code by registering a callback for the InfoMessage event handler."
Do they cause significant overheard? Probably not. Would I allow them to remain in the procedure when they serve no purpose for the application? NO.
精彩评论