• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Designing SQL Server Stored P... > The SET NOCOUNT Statement

The SET NOCOUNT Statement

The SET NOCOUNT statement, when set to ON, eliminates the “xx row(s) affected” message in the Query Analyzer window. It also eliminates the DONE_IN_PROC communicated from SQL Server to the client application. For this reason, the SET NOCOUNT ON statement, when included, improves the performance of the stored procedure. Here's an example:

CREATE PROCEDURE procGetCustomersNoCount AS
SET NOCOUNT ON
SELECT CompanyName, ContactName, ContactTitle, City
FROM Customers
ORDER BY City, CompanyName


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint