>From the SQL Server BOL:
SET NOCOUNT
Stops the message indicating the number of rows affected by a Transact-SQL
statement from being returned as part of the results.
Syntax
SET NOCOUNT { ON | OFF }
Remarks
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.
The @@ROWCOUNT function is updated even when SET NOCOUNT is ON.
SET NOCOUNT ON eliminates the sending of DONE_IN_PROC messages to the client
for each statement in a stored procedure. When using the utilities provided
with Microsoft(r) SQL Server(tm) to execute queries, the results prevent "nn
rows affected" from being displayed at the end Transact-SQL statements such
as SELECT, INSERT, UPDATE, and DELETE.
For stored procedures that contain several statements that do not return
much actual data, this can provide a significant performance boost because
network traffic is greatly reduced.
The setting of SET NOCOUNT is set at execute or run time and not at parse
time.
Jeff Garza
Web Developer/Webmaster
Spectrum Astro, Inc.
480.892.8200
[EMAIL PROTECTED]
http://www.spectrumastro.com
-----Original Message-----
From: Mike Kear [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 9:42 AM
To: CF-Talk
Subject: RE: @@identidy in sql server 7
What does the "set nocount on" do?
Cheers,
Mike Kear
Windsor, NSW, Australia
AFP WebWorks
-----Original Message-----
From: Diana Nichols [mailto:[EMAIL PROTECTED]]
set nocount on
insert into table ()
values ()
select @@identity as newID
set nocount off
HTH
D
*************
Diana Nichols
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists