Jump: Search:

Free Resources from FMS

Additional Resources

 

Thank you! Thank you! I just finished reading this document, which was part of a link in the recent Buzz newsletter. I have printed it for others to read, especially those skeptical on the powers of Access and its capabilities.

Darren D.

 

Free Catalog

 

 

Improve performance of Stored Procedures by using SET NOCOUNT ON

Provided by:  FMS Development Team

In Microsoft SQL Server, when executing a Transact-SQL statement, the number of ‘rows affected’ is returned by default. As an example, execute the following in SQL Analyzer:

Use Pubs
Update authors
Set Contract = 1
WHERE State = 'KS'

When this query is executed, the messages pane displays:

(1 row(s) affected)

Because additional processing time is needed to ascertain the number of rows affected, turning off this feature can reduce the overall time needed to process a stored procedure. This can be accomplished by using the SET NOCOUNT ON command. Add it to the start of the above example, and when executed, notice that the rows affected message is suppressed. To reactivate the rows affected, use SET NOCOUNT OFF.

This tip and more detected by Total SQL Analyzer PRO

 

Return to the tips page

 
Feedback

Contact Us  l   Web questions: Webmaster   l   Copyright © FMS, Inc., Vienna, Virginia
Celebrating our 26th Year of Software Excellence