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;
The last END should be aligned with CASE or should be on the same line.

Thanks for fixing it!

Style attached...

Torsten
MVP
torsten.strauss
0

Comments

3 comments

  • Tianjiao_Li
    Hi @torsten.strauss

    If you uncheck the highlighted option, the last END should be aligned with CASE.



    Tianjiao_Li
    0
  • torsten.strauss
    Hi Tianjiao ,

    nice to see a workaround but I consider this as a bug...

    What do you think?

    Thanks!
    torsten.strauss
    0
  • Tianjiao_Li
    Hi @torsten.strauss

    It looks like Collapse Case expressions shorter than xx characters overrules other settings for CASE. Therefore it needs to be cleared if that not needed.
    Tianjiao_Li
    0

Add comment

Please sign in to leave a comment.