Skip to content

Settings and activity

10 results found

  1. 6 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  SQL Prompt  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    DataJanitor commented  · 

    Here's a more interesting example - imagine what it'll look like on a table with a couple hundred columns, or worse, with the maximum of 1,024 columns.

    USE [tempdb]

    DROP TABLE IF EXISTS [test]

    CREATE TABLE [TEST]
    (
    [a_Watch_How_Each_CASE_is_farther_to_the_right] TINYINT NOT NULL PRIMARY KEY
    ,[b] TINYINT NOT NULL
    ,[c] TINYINT NULL
    ,[d] TINYINT
    ,[e] TINYINT
    )

    INSERT INTO [TEST]
    VALUES
    (
    1, 2, 3, 4, 5
    )
    ,(
    2, 3, 4, NULL, 5
    )

    DROP TABLE IF EXISTS [test2]

    CREATE TABLE [TEST2]
    (
    [a_Watch_How_Each_CASE_is_farther_to_the_right] TINYINT NOT NULL PRIMARY KEY
    ,[b] TINYINT NOT NULL
    ,[c] TINYINT NULL
    ,[d] TINYINT
    ,[e] TINYINT
    )

    INSERT INTO [TEST2]
    VALUES
    (
    1, 2, 3, 4, 5
    )
    ,(
    2, 4, 4, 3, 5
    )

    SELECT
    CASE
    WHEN [X].[a_Watch_How_Each_CASE_is_farther_to_the_right] IS NULL THEN 'Y only'
    WHEN [Y].[a_Watch_How_Each_CASE_is_farther_to_the_right] IS NULL THEN 'X only'
    ELSE CASE
    WHEN ([X].[a_Watch_How_Each_CASE_is_farther_to_the_right] <> [Y].[a_Watch_How_Each_CASE_is_farther_to_the_right]) THEN 'a,'
    ELSE ''
    END + CASE
    WHEN ([X].[b] <> [Y].[b]) THEN 'b,'
    ELSE ''
    END + CASE
    WHEN
    (
    ([X].[c] <> [Y].[c])
    OR
    (
    (
    ([X].[c] IS NULL)
    AND ([Y].[c] IS NOT NULL)
    )
    OR
    (
    ([X].[c] IS NOT NULL)
    AND ([Y].[c] IS NULL)
    )
    )
    ) THEN 'c,'
    ELSE ''
    END + CASE
    WHEN
    (
    ([X].[d] <> [Y].[d])
    OR
    (
    (
    ([X].[d] IS NULL)
    AND ([Y].[d] IS NOT NULL)
    )
    OR
    (
    ([X].[d] IS NOT NULL)
    AND ([Y].[d] IS NULL)
    )
    )
    ) THEN 'd,'
    ELSE ''
    END + CASE
    WHEN
    (
    ([X].[e] <> [Y].[e])
    OR
    (
    (
    ([X].[e] IS NULL)
    AND ([Y].[e] IS NOT NULL)
    )
    OR
    (
    ([X].[e] IS NOT NULL)
    AND ([Y].[e] IS NULL)
    )
    )
    ) THEN 'e,'
    ELSE ''
    END
    END AS [Differences]
    ,[X].[a_Watch_How_Each_CASE_is_farther_to_the_right] AS [X_a]
    ,[Y].[a_Watch_How_Each_CASE_is_farther_to_the_right] AS [Y_a]
    ,[X].[b] AS [X_b]
    ,[Y].[b] AS [Y_b]
    ,[X].[c] AS [X_c]
    ,[Y].[c] AS [Y_c]
    ,[X].[d] AS [X_d]
    ,[Y].[d] AS [Y_d]
    ,[X].[e] AS [X_e]
    ,[Y].[e] AS [Y_e]
    FROM [TEST] AS [X]
    FULL OUTER JOIN [TEST2] AS [Y]
    ON (([X].[a_Watch_How_Each_CASE_is_farther_to_the_right] = [Y].[a_Watch_How_Each_CASE_is_farther_to_the_right]))

    DataJanitor shared this idea  · 
  2. 36 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  SQL Prompt  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    DataJanitor supported this idea  · 
  3. 47 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    3 comments  ·  SQL Prompt  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    DataJanitor supported this idea  · 
  4. 103 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    DataJanitor supported this idea  · 
  5. 57 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    DataJanitor supported this idea  · 
  6. 71 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    DataJanitor supported this idea  · 
  7. 86 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    DataJanitor supported this idea  · 
  8. 9 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    DataJanitor supported this idea  · 
  9. 4 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    DataJanitor supported this idea  · 
  10. 11 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    DataJanitor supported this idea  ·