While we are on this subject of StoredProcs, what would be the best book
to buy... I understand SQL, but little things like returning RS and the
set nocount on etc.... I would appreciate this sent to
[EMAIL PROTECTED] so as to not bog down the list..



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 16 May 2001 3:39 AM
> To: CF-Talk
> Subject: RE: @@identidy in sql server 7
>
> SET NOCOUNT - determines if SQL returns the number of rows affected by
the SQL
> command. So for an insert ... SQL would return a 1 (if successfully
insert one
> row) or 0 (if the insert failed due to unique constraint or something)
for the
> number of rows affected vice the SELECT @@identity. CFQUERY expects a
single
> return set and drops the others ... first one back wins.
>
> Note that if the INSERT was wrapped in a stored procedure and you used
> cfstoredproc, you could return multiple result sets and in one have
the number
> of rows affected and the @@identity value in another etc.
> Bill
>
> In a message dated Tue, 15 May 2001  1:21:17 PM Eastern Daylight Time,
"Mike
> Kear" <[EMAIL PROTECTED]> writes:
>
> << 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
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to