CASE
torsten.strauss
Posts: 271 Silver 3
in SQL Prompt
Hi Redgate Team,
SQL Prompt formats the following code like below:
SET @sql =
N'SELECT name FROM sys.databases WHERE 1=1'
+ CASE WHEN @system_only = 1 THEN ' AND database_id IN (1,2,3,4)' ELSE '' END
+ CASE WHEN @dblist IS NOT NULL THEN ' AND name IN (' + @dblist + ')' ELSE
'' END;
N'SELECT name FROM sys.databases WHERE 1=1'
+ CASE WHEN @system_only = 1 THEN ' AND database_id IN (1,2,3,4)' ELSE '' END
+ CASE WHEN @dblist IS NOT NULL THEN ' AND name IN (' + @dblist + ')' ELSE
'' END;
The last END should be aligned with CASE or should be on the same line.Thanks for fixing it!
Style attached...
Torsten
MVP
MVP
Tagged:
Answers
If you uncheck the highlighted option, the last END should be aligned with CASE.
Tianjiao Li | Redgate Software
Have you visited our Help Center?
It looks like Collapse Case expressions shorter than characters overrules other settings for CASE. Therefore it needs to be cleared if that not needed.
Tianjiao Li | Redgate Software
Have you visited our Help Center?