Closed sommarskog closed 1 year ago
i think there was some reason for the current behavior of only preserving empty lines in comments and strings but I don't remember what it was. Let's see if always appending the empty lines doesn't break any tests.
slask.txt If you attempt to load the attached file in the Northwind database, you will get this error:
If you account for the initial batch, you add 2 to 34 and you to line 36 in file to look at:
and you ask yourself, what's wrong with that?
Answer: absolutely nothing. But if you move to line 41 in the file, you find:
And that is not legal T-SQL.
If you remove the extraneous = and load the file again, it succeeds. If you run
You find why the line number was not reported correctly; All blank lines have been stripped out.
Lest you think this is a very small thing, it is not. This is a complete show-stopper for me to start using go-sqlcmd. I use SQLCMD to load stored procedures from my Editor, and having correct line numbers is absolutely essential.