Settings and activity
10 results found
-
6 votes
An error occurred while saving the comment DataJanitor shared this idea · -
36 votesDataJanitor supported this idea ·
-
47 votesDataJanitor supported this idea ·
-
103 votesDataJanitor supported this idea ·
-
57 votesDataJanitor supported this idea ·
-
72 votesDataJanitor supported this idea ·
-
86 votesDataJanitor supported this idea ·
-
9 votesDataJanitor supported this idea ·
-
4 votes
Hi Amanda,
Would the ‘wrap lines longer than X characters’ option in the formatting styles help with this?
Tim
DataJanitor supported this idea · -
11 votesDataJanitor supported this idea ·
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]))