Viewing 15 posts - 2,806 through 2,820 (of 2,893 total)
Look, your code does enter the next (second) "try" block! But why you expect "error, and display the "Round 2" select"? There is no error to catch in this block...
June 2, 2010 at 10:25 am
I need to clarify :
elutin (6/2/2010)
June 2, 2010 at 10:06 am
This one, does return proper results, However, on the given dataset sample, it performs 3 scans & 26 logical reads (incl. 24 reads of CTE worktable) vs 34 scans but...
June 2, 2010 at 9:55 am
Your code behaves exactly as it is written.
It returns only one error as it is one error happens.
Do you expect your code to stop after the firts error?
Then you...
June 2, 2010 at 7:57 am
Instead of table structure, could you please provide CREATE TABLE and test DATA population scripts to represent your question in a way that would help your potential helpers. Something like
CREATE...
June 2, 2010 at 7:47 am
Chris Morris-439714 (6/2/2010)
This should be reasonably quick, and it's simple to understand and use, too:...
Unfortunately, your version will not work for situations where the price returns back to what it...
June 2, 2010 at 7:41 am
Bhuvnesh (6/2/2010)
elutin (6/2/2010)
...
,@Product...
June 2, 2010 at 6:14 am
As promised, another version. It contains much more code, but it's probably the fastest way to do what you require:
--We need to copy the data from the master table to...
June 2, 2010 at 5:22 am
I guess, using "quirky" update method will give better performance. I cannot show it today, but will do it tomorrow
June 1, 2010 at 3:02 pm
Brandie Tarvin (6/1/2010)
elutin (6/1/2010)
SET @Package = NULLIF(@Package, '**SELECT ALL**')
NULLIF? That's the first time I've heard of that function. I'm glad I read this thread.
It's not really a function as such....
June 1, 2010 at 9:39 am
Sorry, you need small modification in it:
SELECT id, EGType, Dates
FROM dbo.Table_1
WHERE (@Package IS NULL OR EGTYPE = @Package)
AND (@Date IS NULL OR...
June 1, 2010 at 9:36 am
After looking into use of CROSS & OUTER APPLY (my curiosity was influenced by Paul White NZ who suggested more efficient solution for one of the last topics...)
I can suggest...
June 1, 2010 at 9:26 am
What about if the price changes back to the same value as it was before:
INSERT INTO #Temp (Name ,Price ,Date)
...
June 1, 2010 at 9:16 am
If I'm guessing right, you're writing a stored proc.
To avoid parameter sniffing (which happen in this kind of stored proc) copy values from stored proc input parameters into local variables...
June 1, 2010 at 8:41 am
you can use this:
DECLARE @Package char (50)
DECLARE @Date smalldatetime
DECLARE @nulldates bit
-------------------
SET @Package = '**SELECT ALL**'
--SET @Package = 'A'
-------------------
SET @Date = '2010-05-01 00:00:00'...
June 1, 2010 at 7:33 am
Viewing 15 posts - 2,806 through 2,820 (of 2,893 total)