RE: Stored Proc Question

2005-01-21 Thread Robertson-Ravo, Neil (RX)
will be faster such as use of memory etc. It is not all about how fast you get results back. -Original Message- From: Andy Ousterhout [mailto:[EMAIL PROTECTED] Sent: 21 January 2005 00:13 To: CF-Talk Subject: RE: Stored Proc Question I thought that even with simple queries that Stored Procs where

RE: Stored Proc Question

2005-01-21 Thread Andy Ousterhout
Good point. But you can't use query caching without placing in application or session scope and still use cfqueryparam -Original Message- From: Robertson-Ravo, Neil (RX) In some cases yes but in reality if you are using query caching with cfquery it can be just as fast. For simple

RE: Stored Proc Question

2005-01-21 Thread Robertson-Ravo, Neil (RX)
Caching with CFQUERY? To be honest I rarely use CFQUERY now apart from QoQ so I am a tad rusty on its ins and outs ;-) -Original Message- From: Andy Ousterhout [mailto:[EMAIL PROTECTED] Sent: 21 January 2005 13:51 To: CF-Talk Subject: RE: Stored Proc Question Good point. But you

Re: Stored Proc Question

2005-01-21 Thread Jochem van Dieten
Andy Ousterhout wrote: I thought that even with simple queries that Stored Procs where much faster? That is not my experience. YMMV Jochem ~| Logware: a new and convenient web-based time tracking application. Start tracking

Re: Stored Proc Question

2005-01-21 Thread Jared Rypka-Hauer - CMG, LLC
Has anyone tested simple cached queries with CFQUERY against the performance of sp_executesql and SQL statement strings? Functionally it's exactly the same as cfquery in that variables are replaced with values... however, the DB does the work and the CF server simply issues directives and receives

Re: Stored Proc Question

2005-01-20 Thread Jochem van Dieten
Andy Ousterhout wrote: Lets say that I need to look up an invoice by 2 different mechanisms: Internal reference/Key 2 strings Will the execution plan for a stored proc for the Key be different enough from one for the strings to justify creating 2 stored procs? Right now I've got a

RE: Stored Proc Question

2005-01-20 Thread Andy Ousterhout
Here is the proc that I am using. You suggest either 2 separate queries or 2 procs? create proc spreadInvoice @InvoiceNumber int, /*Provide either Invoice Number or both */ @PeachTreeInvoice char(21), /* Peachtree Invoice Number and */ @PeachtreeKey

Re: Stored Proc Question

2005-01-20 Thread Jochem van Dieten
Andy Ousterhout wrote: Here is the proc that I am using. You suggest either 2 separate queries or 2 procs? WHERE ((@InvoiceNumber IS NOT NULL) AND (tabInvoices.InvoiceNumber [EMAIL PROTECTED])) OR ((@PeachtreeKEY IS NOT NULL) AND (@PeachtreeInvoice IS NOT NULL)

RE: Stored Proc Question

2005-01-20 Thread Andy Ousterhout
I thought that even with simple queries that Stored Procs where much faster? I tried this on a couple of other SELECTS and got noticable improvement. By the way, I always use CFQUERRPARAM. Andy -Original Message- From: Jochem van Dieten Andy Ousterhout wrote: Here is the proc that I

RE: Stored Proc Question Help Please

2003-06-06 Thread Haggerty, Mike
You need to write a cursor, it sounds like. Take a look in the books online to get a sense of how it works. M -Original Message- From: Eric Creese [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:29 AM To: CF-Talk Subject: Stored Proc Question Help Please This is a very

RE: Stored Proc Question Help Please

2003-06-06 Thread John Stanley
The syntax I have attached actually uses two temp tables and then unions them at the end, but does use a cursor to loop with. Keep in mind this is SQL 6.5, and some of the functionality might be depricated or changed: create table #temp_origin_records ( summary_id int,

RE: Stored Proc Question Help Please

2003-06-06 Thread webguy
Although a trigger would be better. Much more efficient in this case. WG -Original Message- From: Haggerty, Mike [mailto:[EMAIL PROTECTED] Sent: 05 June 2003 15:48 To: CF-Talk Subject: RE: Stored Proc Question Help Please You need to write a cursor, it sounds like. Take a look

RE: Stored Proc Question Help Please

2003-06-06 Thread Adrian Lynch
What's the relationship between the two tables? Ade -Original Message- From: Eric Creese [mailto:[EMAIL PROTECTED] Sent: 05 June 2003 15:29 To: CF-Talk Subject: Stored Proc Question Help Please This is a very simple question. I need to do this in SQL Server from a job not a CF page.

RE: Stored Proc Question Help Please

2003-06-06 Thread Tony Walker
SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS OFF GO create PROCEDURE dbo.sp_getId AS BEGIN declare @intError int if object_id('tempdb..#myTempTable') is not null drop #myTemptable /* Create Table */

RE: Stored Proc Question Help Please

2003-06-06 Thread Eric Creese
Thanks I will see what I can do with this. I appreciate you time and your help. -Original Message- From: John Stanley [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:53 AM To: CF-Talk Subject: RE: Stored Proc Question Help Please The syntax I have attached actually uses two

Re: Stored Proc Question Help Please

2003-06-06 Thread Jochem van Dieten
Eric Creese wrote: This is a very simple question. I need to do this in SQL Server from a job not a CF page. I have a table where I store customer IDs. I want to pull the individual IDs and loop each ID out of the table and run it against another query and write that output of the

RE: Stored Proc Question Help Please

2003-06-06 Thread Eric Creese
I guess I could try this -Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:07 AM To: CF-Talk Subject: Re: Stored Proc Question Help Please Eric Creese wrote: This is a very simple question. I need to do this in SQL Server from

RE: Stored Proc Question Help Please-SOLVED

2003-06-06 Thread Eric Creese
Thanks for everyones input! ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ:

RE: Stored Proc Question

2001-08-13 Thread Dave Watts
Hello, i'm running a stored proc that contains two queries. if the first query runs and does not return records, i need to run the second query. Can anyone tell me the equivilent of recordCount in Transact-SQL? Thanks. You should be able to use @@ROWCOUNT for this. Dave Watts, CTO, Fig

Re: Stored Proc Question

2001-08-13 Thread Wjreichard
If your running a SELECT statement you can include COUNT(*) as an extra column. If you are running another SQL statement which does not return a recordset (INSERT, DELETE, UPDATE) you can check the @@ROWCOUNT something like: IF @@ROWCOUNT = 0 YOUR SECOND QUERY Cheers, Bill In a

RE: Stored Proc Question

2001-08-13 Thread Andy Ewings
First Query here IF @@rowcount = 0 BEGIN -- Second query here END -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net --

RE: Stored Proc Question

2001-08-13 Thread Shawn Grover
if you need to refer to the rowcount in more than one place. My $.25 worth... Shawn Grover -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, August 13, 2001 10:56 AM To: CF-Talk Subject: RE: Stored Proc Question First Query here IF @@rowcount = 0 BEGIN