Forum Replies Created

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

  • RE: Normalization

    sgmunson - Wednesday, April 25, 2018 8:03 AM

    ScottPletcher - Tuesday, April 24, 2018 2:57 PM

  • RE: Normalization

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

    ScottPletcher - Tuesday, April 24, 2018 12:12 PM

  • RE: Normalization

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

    ScottPletcher - Tuesday, April 24, 2018 7:53 AM

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

  • RE: Normalization

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

    ScottPletcher - Tuesday, April 24, 2018 7:53 AM

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

  • RE: Normalization

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

    DBA Live - Monday, April 23, 2018 4:30 PM

    April 24, 2018 at 7:53 am

    #1988019

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

  • RE: Calculating Date Difference


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

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

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

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

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

  • RE: Where Clause Logic

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

    ScottPletcher - Thursday, April 19, 2018 8:22 AM

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

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