I have a view that works perfectly fine and looks something like this:
WITH xxx AS ( ... ), yyy AS ( SELECT ... FROM xxx ) SELECT ... FROM yyy
Pretty simple and it works great. However, a situation arose, and I need to make minor changes to xxx
. I go into the view editor, make a small change to xxx, but when I save / execute, the Server Management Studio automatic format automatically switches and decides to change my view of this:
WITH yyy AS ( SELECT ... FROM xxx), xxx AS ( ... ) SELECT ... FROM yyy
It basically switches the first and second parts of my WITH statement for no apparent reason! I tried writing a script in a new query, making changes to it and recreating it, and it does the same.
Is there a way to turn off automatic formatting !? Any other suggestions !?
source share