December 14, 2008 at 1:58 am
I need to know what the following statement does:
set nocount on;
December 14, 2008 at 2:05 am
It suppresses the message about the number of of records that were effected by the SQL Statement.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 15, 2008 at 6:20 am
And you use this to reduce the number of calls back and forth between the stored procedure and the application calling it.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 15, 2008 at 8:56 am
When SET NOCOUNT is ON, the count (indicating the number of rows affected by a Transact-SQL statement) is not returned. When SET NOCOUNT is OFF, the count is returned.
James Howard
December 15, 2008 at 9:12 am
People usually do this in stored procedures to be sure extraneous messages are not necessarily sent to the client.
Typically this doesn't have a huge effect.
December 15, 2008 at 2:32 pm
yousef.am (12/14/2008)
I need to know what the following statement does:set nocount on;
Save yourself some huge amounts of time in the future... learn to use Books Online, the "help system" for SQL Server. Like good spaghetti sauce, "It's in there". 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
December 15, 2008 at 2:34 pm
You'll also find that it's absolutely necessary to keep from getting "false returns" in a GUI that may be interpretted as error messages, especially on triggers.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply