Forum Replies Created

Viewing 15 posts - 3,121 through 3,135 (of 7,619 total)

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

  • RE: Understanding the numeric and decimal data types

    Jonathan AC Roberts - Tuesday, October 9, 2018 10:32 AM

    ScottPletcher - Tuesday, October 9, 2018 10:19 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: Understanding the numeric and decimal data types

    Jonathan AC Roberts - Tuesday, October 9, 2018 10:14 AM

    ScottPletcher - Tuesday, October 9, 2018 9:50 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: Understanding the numeric and decimal data types

    Jonathan AC Roberts - Tuesday, October 9, 2018 9:38 AM

    ScottPletcher - Tuesday, October 9, 2018 9:27 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: Understanding the numeric and decimal data types

    michael.leach2015 - Monday, October 8, 2018 9:43 PM

    Jonathan AC Roberts - Monday, October 8, 2018 7:58 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: Algorithm to combine 2 integer into one value and then disintegrate back into two

    Jeff Moden - Monday, October 8, 2018 8:36 PM

    _rohit_ - Monday, October 8, 2018 5:11 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: SQL Query to split values

    If you want to limit the delimiters to strictly:dot, comma, underscore and space, in the code below, change:
    PATINDEX('%[^A-Z0-9]%'
    to
    PATINDEX('%[.,_ ]%'


    SELECT
        CASE...

    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: Algorithm to combine 2 integer into one value and then disintegrate back into two

    Jonathan AC Roberts - Saturday, October 6, 2018 4:12 AM

    _rohit_ - Wednesday, October 3, 2018 8:27 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: Understanding the numeric and decimal data types

    Yes, they are the same in SQL Server.

    SQL chose not to treat extra decimal positions as en error, instead it implicitly rounds to the stored scale.  I assume...

    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: sp_RefreshSQLModule run on a view completely changed the view definition

    Fwiw, I usually stick to sp_refreshview for views, and only use the broader module proc when I need to.

    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,121 through 3,135 (of 7,619 total)