Forum Replies Created

Viewing 15 posts - 1,036 through 1,050 (of 1,228 total)

  • RE: A twist on the Merge statement

    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))...

  • RE: what laptop do you use?

    GilaMonster (7/21/2010)


    HP Pavillion Wide-screen 15.4. It's an entertainment notebook, which for me means pretty good specs without too high a price. Runs SQL well, plays movies, runs games, just about...

  • RE: Pivot I guess

    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...

  • RE: what laptop do you use?

    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...

  • RE: temp table in view

    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...

  • RE: Parent/Child relationship

    CELKO (10/28/2010)


    "I can resist anything but temptation" -- Mae West

    Commendable restraint, Joe.

  • RE: Parent/Child relationship

    Chrissy321 (10/28/2010)


    Which brings me to this....

    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...

  • RE: Parent/Child relationship

    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...

  • RE: using group by and count together.

    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...

  • RE: using group by and count together.

    BenWard (10/28/2010)


    haha yes

    which is (I think) exactly the same as

    ;WITH cteSource(Data)

    AS (

    SELECT 1

    ...

  • RE: using group by and count together.

    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...

  • RE: In Line Subquery versus Join query

    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.......

  • RE: Really Simple - "Join" clarification

    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...

  • RE: insert if not exists, if it does insert into another table

    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...

  • RE: Hard coding leading zeros to Unique IDs

    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?

Viewing 15 posts - 1,036 through 1,050 (of 1,228 total)