Use a strored procedure to do both jobs, 

Jason Lees
Development Team Leader
National Express Coaches Ltd.



-----Original Message-----
From: Bosky, Dave [mailto:[EMAIL PROTECTED]]
Sent: 06 February 2003 15:23
To: CF-Talk
Subject: Proper SQL statements


Is there a better more efficient way of writing these 2 queries such as
combining them into a single query?
I will eventually convert it into a stored procedure.

<CFQUERY Name="qNumCurrentRecs" datasource="dsn">
        SELECT COUNT(*) AS RecsAvailable 
        FROM tbl_reports_FlapList
</CFQUERY>
<CFQUERY Name="qRemoveCurrentFlapList" datasource="dsn">
        DELETE 
        FROM tbl_reports_FlapList
        WHERE FlapListID IN
                (SELECT FlapListID FROM tbl_reports_FlapList)
</CFQUERY>

Regards,
Dave Bosky
Sr. Multimedia Web Designer
Horry Telephone Cooperative, Inc. 
office: (843)369-8613
[EMAIL PROTECTED]



HTC Disclaimer:  The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of this
message is not the intended recipient, or an employee or agent responsible
for delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error, please notify us immediately by replying to the
message and deleting it from your computer.  Thank you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to