Doh!

Forgot the NOCOUNTs

<CFQUERY NAME="foo" DATASOURCE="bar">
        SET NOCOUNT ON

        INSERT INTO foo (bar)
        VALUES ("homer")

        SELECT *
        FROM foo
        WHERE fooid = Scope_Identity()
        
        SET NOCOUNT OFF
</CFQUERY>

-----Original Message-----
From: Mike Townend [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 15, 2003 21:15
To: '[EMAIL PROTECTED]'
Subject: RE: insert/select



Depends on what DB you are using... This *should* be valid for SQL2k

<CFQUERY NAME="foo" DATASOURCE="bar">
        INSERT INTO foo (bar)
        VALUES ("homer")

        SELECT *
        FROM foo
        WHERE fooid = Scope_Identity()
</CFQUERY>




-----Original Message-----
From: Michael Dinowitz [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 15, 2003 21:07
To: SQL
Subject: insert/select


Is there a way of doing an insert and a select on the data that was just
inserted as a single operation inside a CFQUERY tag? Not in an SP, but as
straight SQL. If not, I'll have to do the transaction, insert, select thing.
I'm just looking for the best option. Thanks

Michael Dinowitz
Finding technical solutions to the problems you didn't know you had yet


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:6
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:6
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=<:emailid:>.<:userid:>.<:listid:>

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

                        

Reply via email to