Forum Replies Created

Viewing 15 posts - 3,106 through 3,120 (of 7,613 total)

  • RE: What's wrong with my table?

    I agree with the other critiques.  As to "the guy", he's 100% right, and he should already run, not walk, to another contractor, without delay!

    1NF is trivial and...

    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: Talking about SARG

    Never use ISNULL() in a JOIN (or WHERE) is a good rule.

    To avoid issues with NULL, perhaps you could use empty string as no suborder rather than NULL?

    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: Convert Local Time to UTC

    I suggest using MINUTE rather than HOUR as the difference between local and UTC.  Yes, some places actually do offset by not-an-even-hour, so, to be safe, use minutes.

    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: What are some really dumb things you could write in a SQL Query

    Matt Miller (4) - Friday, October 12, 2018 2:53 PM

    ScottPletcher - Friday, October 12, 2018 1:51 PM

    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: What are some really dumb things you could write in a SQL Query


    set @counter = @counter + 1 /* increment counter */  /* I see this or slight variations of it all the time */
    --------------------...
    /* not quite...

    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: Showing all records that appear more than once

    Jonathan AC Roberts - Thursday, October 11, 2018 9:07 AM

    drew.allen - Thursday, October 11, 2018 8:26 AM

    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: What are some really dumb things you could write in a SQL Query

    Jeff Moden - Wednesday, October 10, 2018 5:07 PM

    ScottPletcher - Wednesday, October 10, 2018 4:16 PM

    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: What are some really dumb things you could write in a SQL Query

    Jeff Moden - Wednesday, October 10, 2018 3:49 PM

    ScottPletcher - Wednesday, October 10, 2018 10:47 AM

    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: looping through all databases to find dependencies (cursor)

    The easiest and cleanest way to do this would be to create stored proc in the master db, start the name with "sp_", mark it as a system object, and...

    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: What are some really dumb things you could write in a SQL Query

    Scott Coleman - Wednesday, October 10, 2018 2:14 PM

    I inherited code from someone who couldn't do a thing without cursors.  I'd swear...

    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: Showing all records that appear more than once

    drew.allen - Wednesday, October 10, 2018 12:02 PM

    ScottPletcher - Wednesday, October 10, 2018 11:13 AM

    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: Showing all records that appear more than once


    SELECT tn.*
    FROM (
        SELECT NUMBER
        FROM dbo.table_name
        GROUP BY NUMBER
        HAVING COUNT(*) > 1
    ) AS NUMBER_DUPS
    INNER...

    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: What are some really dumb things you could write in a SQL Query

    In terms of potential lost performance and wasted resources, this is probably the single dumbest thing:


    CREATE TABLE dbo.every_table_created
    (
        id int IDENTITY(1, 1)...

    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: Information from ALL SQL Servers

    Perhaps a 3rd option.  Rather than pulling the data from all instances, have each instance gather that info on itself and push it to a central location.

    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: Understanding the numeric and decimal data types

    Lynn Pettis - Tuesday, October 9, 2018 1:25 PM

    Vardecimal was deprecated:

    Vardecimal storage formatUse of vardecimal storage format was encountered. Use data compression...

    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 - 3,106 through 3,120 (of 7,613 total)