Viewing 15 posts - 1,051 through 1,065 (of 1,228 total)
Run them both and look at the actual execution plans. You may be surprised to find they are the same or "trivially different" - maybe.
October 27, 2010 at 7:31 am
Guessing that your unique ID's are integer, you will need to cast them to a string type, preferably a CHAR of the correct length.
Why do you want to do this?
October 27, 2010 at 6:56 am
You're welcome 🙂 Thanks loads for providing scripts and a perfect spec!
October 27, 2010 at 6:46 am
You're welcome.
If you choose to go down the table route, you could "encapsulate" the code within a (CROSS) APPLY to provide a very fast solution.
October 27, 2010 at 6:35 am
keymoo (10/27/2010)
🙂 I hope your manflu is being kind to you. I now get:
Msg 207, Level 16, State 1, Line 18
Invalid column name 'rn'.
LOL thanks! It's not the manflu which...
October 27, 2010 at 6:32 am
keymoo (10/27/2010)
Thanks I did that and I now get:
Msg 207, Level 16, State 1, Line 5
Invalid column name 'accountPerformance'.
:unsure:
Don't worry, we'll get there.
;WITH OrderedData AS (
SELECT tradeId, pctAccountRisked, profit, tradeDateTime,
...
October 27, 2010 at 6:07 am
Thanks for posting.
Here's a handy reference for you:
http://msdn.microsoft.com/en-us/library/ms187489.aspx
Which would make your code much more compact for the next step:
---------------------- Albania POSTCODE VALIDATION ----------------
ELSE IF @COUNTRY = 'Albania'
set @Result=(SUBSTRING(@ADDRESSLINE,...
October 27, 2010 at 6:03 am
Deepthy (10/27/2010)
Some part of your SQL statement is nested too deeply. Rewrite the query or...
October 27, 2010 at 5:20 am
Brandie Tarvin (10/27/2010)
October 27, 2010 at 5:09 am
keymoo (10/27/2010)
Hi Chris, thanks for you reply. It doesn't seem to work, I get this error:
Msg 137, Level 15, State 2, Line 18
Must declare the scalar variable "@nannyRisk".
Put this at...
October 27, 2010 at 4:53 am
It's perfectly valid code as others have pointed out. It's interpreted by SQL Server as this:
select s.SSN from #Select s where s.SSN in (Select s.SSN from #SubSelect ss)
October 27, 2010 at 4:31 am
Wow, what a great question! And I'm stuck at home with manflu and an expired evaluation copy of SQL2k8.
Ok here goes:
;WITH OrderedData AS (
SELECT accountPerformance, tradeId, pctAccountRisked, profit, tradeDateTime,
rn =...
October 27, 2010 at 4:24 am
Maina-456685 (10/27/2010)
I hope it makes sense now: i need an sp that does the following:
Condition 1: If an entry is duplicated in TempCustomer, insert into ContactAudit table.
An entry...
October 27, 2010 at 3:46 am
Sharon, can you post up the actual execution plan for this query?
October 26, 2010 at 11:47 am
You need to write the query properly first - if this returns the correct rows, it's by accident, not by design. Something like this:
select t1.*, t2.*, t3.*
FROM TABLE1...
October 26, 2010 at 11:30 am
Viewing 15 posts - 1,051 through 1,065 (of 1,228 total)