Formatting in CASE WHEN expression removes dot if schemaname is present and dot followed by space
atolmeijer
Posts: 4 New member
in SQL Prompt
The following code dows not format properly, even not in SQL Prompt 10.0.01:
USE tempdb
GOCREATE SCHEMA red;
GO
CREATE TABLE red.Gate( ColumnA INT )
GO
SELECT CASE WHEN Rg. ColumnA = 1
THEN 1
WHEN Rg. ColumnA = 2
THEN 2
END AS Col
FROM red.Gate AS Rg
GO
DROP TABLE red.Gate;
GO
DROP SCHEMA red;
GO
Tagged:
Answers
The underlying is due to a parsing/syntax error and thus SQL Prompt is unable to format it.
You can see this by using the built in SSMS check mark for checking parsing.
I hope this helps!
Thanks,
Dan
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?
Apologies! I understand what you mean now, I've been able to replicate the issue exactly. I'm now raising this with the development team as a bug with Prompt.
Thanks,
Dan
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?