A small free .Net and JS library (with demo UI, command-line bulk formatter, SSMS/VS add-in, notepad++ plugin, winmerge plugin, and demo webpage) for reformatting and coloring T-SQL code to the user's preferences.
When formatting a dockument in SSMS a new line and spacing is inserted before the [/noformat] tag.
This is done every time the document is formatted resulting in more and more empty lines above the [/noformat] tag:
Original query:
IF @Ref IS NULL
BEGIN
IF @DebugMsg = 'x1'
BEGIN
--[noformat]
PRINT 'Some debug info'
--[/noformat]
END
--[noformat]
SELECT something from table
--[/noformat]
END;
Formatted once:
IF @Ref IS NULL
BEGIN
IF @DebugMsg = 'x1'
BEGIN
--[noformat]
PRINT 'Some debug info'
--[/noformat]
END
--[noformat]
SELECT something from table
--[/noformat]
END;
Formatted twice:
IF @Ref IS NULL
BEGIN
IF @DebugMsg = 'x1'
BEGIN
--[noformat]
PRINT 'Some debug info'
--[/noformat]
END
--[noformat]
SELECT something from table
--[/noformat]
END;
When formatting a dockument in SSMS a new line and spacing is inserted before the [/noformat] tag. This is done every time the document is formatted resulting in more and more empty lines above the [/noformat] tag: Original query:
Formatted once:
Formatted twice: