Forum Replies Created

Viewing 15 posts - 7,231 through 7,245 (of 7,613 total)

  • RE: UniqueIdentifier as a Primary Key

    There is NO case where I would ever want to use a GUID as a clustered key column.

    It would have to be THE ONLY WAY POSSIBLE for me to consider...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Indexes Clarification

    GilaMonster (9/12/2012)


    Well, both of those statements are incorrect, so probably better to just ignore them...

    Quite true.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Check that a specific Group By condition does not exist

    Lynn Pettis (9/11/2012)


    Just a quick test using 6 million rows:

    Lynn's method:

    Elapsed Time (ms) 8276

    ScottPletcher's first method:

    Warning: Null value is eliminated by an aggregate or other SET operation.

    Elapsed Time...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Importing only rows with column data in specific columns.

    Lynn Pettis (9/10/2012)


    ScottPletcher (9/10/2012)


    Lynn Pettis (9/10/2012)


    ScottPletcher (9/10/2012)


    Greg Snidow (9/10/2012)


    ScottPletcher (9/10/2012)


    The UNPIVOT (one table scan) looks much better to me than fully scanning the table once for every grade column.

    Yep, as...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Importing only rows with column data in specific columns.

    Lynn Pettis (9/10/2012)


    ScottPletcher (9/10/2012)


    Greg Snidow (9/10/2012)


    ScottPletcher (9/10/2012)


    The UNPIVOT (one table scan) looks much better to me than fully scanning the table once for every grade column.

    Yep, as I said, I...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Importing only rows with column data in specific columns.

    Greg Snidow (9/10/2012)


    ScottPletcher (9/10/2012)


    The UNPIVOT (one table scan) looks much better to me than fully scanning the table once for every grade column.

    Yep, as I said, I put that out...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Check that a specific Group By condition does not exist

    Lynn Pettis (9/7/2012)


    The real test will be against a 1,000,000 (or so) table. I will try and set up such a test tonight at home. One of the...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Importing only rows with column data in specific columns.

    The UNPIVOT (one table scan) looks much better to me than fully scanning the table once for every grade column.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Datatype truncation

    If you want precise control over shortening the results returned from a float column, there is always the ROUND() function.

    If you want precise values, just use decimal to begin with....

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Check that a specific Group By condition does not exist

    Lynn Pettis (9/7/2012)


    The real test will be against a 1,000,000 (or so) table. I will try and set up such a test tonight at home. One of the...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Order by a column keeping the families together

    1. Columns are fields!

    Technically they are not.

    But in practice, many people refer to SQL columns as "fields", so you just have to accept that and move on.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Datatype truncation

    Why does the float value change to a smaller number when the precision increases?

    Maybe just the general nature of floating point values, that they are approximations only.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Datatype truncation

    I am completely unable to get the float value to cast or convert to a varchar and not truncate it

    From BOL:

    "By default, the precision of built-in operations on float data...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Check that a specific Group By condition does not exist

    Lynn Pettis (9/7/2012)


    You may want to compare the execution plans between the two solutions provided:

    CREATE TABLE #tblTemplates

    (

    ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Check that a specific Group By condition does not exist

    SELECT TemplateID

    FROM #tblBlocks

    GROUP BY TemplateID

    HAVING COUNT(DISTINCT CASE WHEN #tblBlocks.BaseStage = 1 THEN BlockID END) = COUNT(DISTINCT BlockID)

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 7,231 through 7,245 (of 7,613 total)