Wednesday, August 30, 2006

 

SET NOCOUNT ON or leave it alone?

I've been taught since I was a wee SQL Serverite to always put SET NOCOUNT ON at the beginning of stored procedures that modify the database so that you don't have to send those pesky "1 row affected" messages back and forth between the client and server. John Galloway made an interesting post today titled "How NOCOUNT ON affects ADO.NET applications" and I've responded with a test script that shows, at least appears to show, just how much faster it is to use SET NOCOUNT ON instead of the default. Anyway, check it out - http://weblogs.asp.net/jgalloway/archive/2006/08/30/How-NOCOUNT-affects-ADO.NET.aspx



Technorati Tags: , , , , ,


AddThis Social Bookmark Button

Comments:
Scott, I just wanted to thank you for responding to my post and offering a very valid counterpoint. I'd been tought that NOCOUNT was just a good thing to do, but never really heard exactly why. It looks like it's most important to use it if you're going to be executing a significant number of SQL operations.

While I do my best to make sure that the information I post is factual, my favorite comments are ones that make me feel stupid. Thanks for making me feel stupid, and hence learning something!
 
Well, I certainly didn't mean to make you feel stupid hehe :)

Thanks for the comments and keep posting. I enjoy reading your blog, John.
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?