Viewing 15 posts - 1,036 through 1,050 (of 1,228 total)
If the source table is more than a few hundred rows, I'd use a temporary table instead of a table variable. You can index a table variable
DECLARE @EXTERNAL_CUSTOMER TABLE(<<columns>>, UNIQUE(CUST_REF))...
October 31, 2010 at 8:40 am
GilaMonster (7/21/2010)
October 29, 2010 at 2:40 pm
Pavan as Craig says, please set up some sample data in the form of a CREATE TABLE statement followed by INSERT to populate your table with data. Include at least...
October 29, 2010 at 2:09 pm
HP HDX 18
P8400 Core 2 Duo, 4GB RAM, Vista Home Premium 64bit (runs SQL2k8 just fine).
Full HD 18" wide aspect ratio screen
2 x ST9250827AS disks
BD burner (plays BD movies nicely).
Fullsize...
October 29, 2010 at 12:35 pm
sravanb (10/28/2010)
Hello All,Is it a good practice to use a temp tables in a view?
How do we handle temp tables in views?
Please explain in detail.
Thank you,
Sra1
Others will provide a far...
October 28, 2010 at 1:23 pm
CELKO (10/28/2010)
"I can resist anything but temptation" -- Mae West
Commendable restraint, Joe.
October 28, 2010 at 12:48 pm
Chrissy321 (10/28/2010)
SELECT
CASE WHEN EXISTS
(
SELECT 1
FROM Parent P
INNER JOIN Child C
ON MyTable.ParentID = P.ParentID
INNER JOIN ChildCustom CC
ON MyTable.ChildID = CC.ChildID
WHERE...
October 28, 2010 at 12:47 pm
Isn't this:
CASE WHEN EXISTS
(
SELECT 1
FROM Parent P
WHERE P.Parent_CD = Child.Parent_CD
AND P.Parent_CD IN
( SELECT DISTINCT P.Parent_CD...
October 28, 2010 at 10:21 am
Hahaha that's too funny!
I bet it's the same performance too.
Ben, if you're interested and have the time, you could assess all three queries for performance using the simplest method:
SET...
October 28, 2010 at 9:01 am
BenWard (10/28/2010)
which is (I think) exactly the same as
;WITH cteSource(Data)
AS (
SELECT 1
...
October 28, 2010 at 5:39 am
BenWard (10/28/2010)
thats brilliant thanks.I'm surprised there isnt an alternative version of count in sql server that returns the number of rows like a numrows() function or whatever.
Thanks
Like this version?
SELECT COUNT(*)
FROM...
October 28, 2010 at 5:12 am
Jeff Moden (10/27/2010)
ChrisM@home (10/27/2010)
Run them both and look at the actual execution plans. You may be surprised to find they are the same or "trivially different" - maybe.
Oh, be careful.......
October 27, 2010 at 11:34 am
drew.allen (10/26/2010)
My issue with defining it as multiple tables is that you lose the fact that the order is important when you start introducing outer joins.
You need to...
October 27, 2010 at 8:21 am
Brandie Tarvin (10/27/2010)
Maina-456685, Could you provide sample data so Chris and I can verify solutions before we post them?
Thanks Brandie. Unfortunately my eval version of 2k8 has just expired so...
October 27, 2010 at 8:12 am
mashikoo (10/27/2010)
I'm trying to include leading zeros to unique IDs in my query
Can you post the query? Also the DDL for one of the tables?
October 27, 2010 at 7:34 am
Viewing 15 posts - 1,036 through 1,050 (of 1,228 total)