Inconsistent new line behavior with comments
a.higgins
Posts: 90 Bronze 2
I make frequent use of comment blocks to separate logical portions of a script (/*Comment*/).
I've noticed that SQL Prompt will sometimes reformat things to start after a comment line, such as the following example:
When I reformat the script, it turns to:
I've seen similar odd results from various statements, including DROP TABLE, SELECT, CREATE TABLE, SET XACT_ABORT ON, TRUNCATE TABLE, INSERT INTO, etc.
Is there a setting or configuration I can use to say, in effect, "Preserve new lines after comment blocks"?
I've noticed that SQL Prompt will sometimes reformat things to start after a comment line, such as the following example:
/* Create Stuff */ CREATE TABLE #x (a INT) CREATE TABLE #y (b INT) CREATE TABLE #z (c INT) /* Drop Stuff */ DROP TABLE #x DROP TABLE #y DROP TABLE #z
When I reformat the script, it turns to:
/* Create Stuff */ CREATE TABLE #x ( a INT ) CREATE TABLE #y ( b INT ) CREATE TABLE #z ( c INT ) /* Drop Stuff */ DROP TABLE #x -- notice this is now on one line DROP TABLE #y DROP TABLE #z
I've seen similar odd results from various statements, including DROP TABLE, SELECT, CREATE TABLE, SET XACT_ABORT ON, TRUNCATE TABLE, INSERT INTO, etc.
Is there a setting or configuration I can use to say, in effect, "Preserve new lines after comment blocks"?
Comments
In this case there should be a line break after the comment so this is a bug. Thanks for reporting it. We're looking into this now.
Cheers
Harry
We believe we've fixed this issue in the latest release (7.3.598). Please let us know if this has fixed it for you or if you have any other problems.
Cheers
Harry