How can we help you today? How can we help you today?

Inconsistent new line behavior with comments

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:
/* 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"?
a.higgins
0

Comments

3 comments

  • Harry Frankish
    Hi

    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
    Harry Frankish
    0
  • Harry Frankish
    Hi a.higgins

    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
    Harry Frankish
    0
  • a.higgins
    Looks beautiful, thanks very much!
    a.higgins
    0

Add comment

Please sign in to leave a comment.