Forum Replies Created

Viewing 15 posts - 3,436 through 3,450 (of 7,613 total)

  • RE: Normalization

    sgmunson - Tuesday, April 24, 2018 2:19 PM

    ScottPletcher - Tuesday, April 24, 2018 12:12 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: Normalization

    sgmunson - Tuesday, April 24, 2018 8:14 AM

    ScottPletcher - Tuesday, April 24, 2018 7:53 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: ?? on While loop go thru each record X number of times

    Standard CROSS JOIN:

    SELECT StudentName, RoomName
    FROM Students
    CROSS JOIN ( VALUES('room1'),('room2'),('room3') ) AS Rooms(RoomName)

    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: Normalization

    sgmunson - Tuesday, April 24, 2018 8:14 AM

    ScottPletcher - Tuesday, April 24, 2018 7:53 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: Calculating Date Difference

    David Burrows - Tuesday, April 24, 2018 6:40 AM


    SELECT
    DATEDIFF(day, COALESCE(date0,dateStart),date1),
    DATEDIFF(day, COALESCE(date1,date0,dateStart),date2),
    DATEDIFF(day, COALESCE(date2,date1,date0,dateStart),date3),
    DATEDIFF(day, COALESCE(date3,date2,date1,date0,dateStart),date4),
    DATEDIFF(day, COALESCE(date4,date3,date2,date1,date0,dateStart),date5),
    DATEDIFF(day, COALESCE(date5,date4,date3,date2,date1,date0,dateStart),date6),
    DATEDIFF(day, COALESCE(date6,date5,date4,date3,date2,date1,date0,dateStart),date7)
    FROM temp

    Nice, but 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: Normalization

    sgmunson - Tuesday, April 24, 2018 6:15 AM

    DBA Live - Monday, April 23, 2018 4:30 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: Normalization

    Yes.  Author and Publisher do not belong in the table shown.  I strongly doubt Edition or Media belongs there either.

    I'm not sure about Date.  I'm not sure how...

    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: Calculating Date Difference


    ;WITH cte_dates AS (
      SELECT t.*, dates2.*
      FROM temp t
      CROSS APPLY (
       SELECT
            MAX(CASE WHEN row_num =...

    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: Subquery as column

    You'll probably get exactly the same execution plan either way.

    But for ease of clarity, coding and maintenance, I'd write it this way:


    SELECT sf.org,...

    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: Transferring data between tables

    Again, the easiest solution is to simply split into two tables.

    You can even keep the original table name if you:
    1) Create the new table, with all 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: break cluster and get sql server available

    I don't know about "broken", but if you "uncluster" it normally, it runs fine.

    And, yes, then you have two servers each running a single, separate, independent instance.

    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: break cluster and get sql server available

    Somewhat confusing:  "has ... active-active, active-passive setup".  Huh, can't be both at the same time, which is it?

    If A-P, I know we've undone/removed clustering and it worked fine,...

    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: Where Clause Logic

    JR11 - Thursday, April 19, 2018 9:05 AM

    ScottPletcher - Thursday, April 19, 2018 8:22 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: Where Clause Logic

    Difficult to tell exactly what you need, but if you want the other conditions to apply to "Developer" too, then do this:


    WHERE (customer = @customer_number)...

    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: Transferring data between tables

    richardmgreen1 - Thursday, April 19, 2018 4:06 AM

    ScottPletcher - Wednesday, April 18, 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".

Viewing 15 posts - 3,436 through 3,450 (of 7,613 total)