Maximize the power of SQL Prompt with SQL Toolbelt Essentials. Watch now.

6.5.0.320 - semicolon in wrong place

PDinCAPDinCA Posts: 642 Silver 1
edited March 30, 2015 12:26PM in SQL Prompt
A valid chunk of DDL is selected, then "Format SQL" is chosen, but there shouldn't be a semicolon after the last selected character.
CREATE TABLE util.SiteTableArchival
   ( SiteID int NOT NULL
   , TableID smallint NOT NULL
   , StatusCode tinyint CONSTRAINT cn_sta_df_StatusCode DEFAULT 0
                          NOT NULL
   , CreatedTS_UTC datetime CONSTRAINT cn_sta_df_CreatedTS_UTC DEFAULT GETUTCDATE()
                              NOT NULL
   , LatestStatusTS_UTC datetime CONSTRAINT cn_sta_df_LatestStatusTS_UTC DEFAULT GETUTCDATE()
                                   NOT NULL
   , ArchiveFilePathAndName nvarchar(4000) NULL
   )
ON [PRIMARY]
GO
But only highlight this part:
CREATE TABLE util.SiteTableArchival
   ( SiteID int NOT NULL
   , TableID smallint NOT NULL
   , StatusCode tinyint CONSTRAINT cn_sta_df_StatusCode DEFAULT 0
                          NOT NULL
   , CreatedTS_UTC datetime CONSTRAINT cn_sta_df_CreatedTS_UTC DEFAULT GETUTCDATE()
                              NOT NULL
   , LatestStatusTS_UTC datetime CONSTRAINT cn_sta_df_LatestStatusTS_UTC DEFAULT GETUTCDATE()
                                   NOT NULL
   , ArchiveFilePathAndName nvarchar(4000) NULL
   )
Then "Format SQL", the resulting code is:
CREATE TABLE util.SiteTableArchival
   ( SiteID int NOT NULL
   , TableID smallint NOT NULL
   , StatusCode tinyint CONSTRAINT cn_sta_df_StatusCode DEFAULT 0
                          NOT NULL
   , CreatedTS_UTC datetime CONSTRAINT cn_sta_df_CreatedTS_UTC DEFAULT GETUTCDATE()
                              NOT NULL
   , LatestStatusTS_UTC datetime CONSTRAINT cn_sta_df_LatestStatusTS_UTC DEFAULT GETUTCDATE()
                                   NOT NULL
   , ArchiveFilePathAndName nvarchar(4000) NULL
   );
ON [PRIMARY]
GO
Jesus Christ: Lunatic, liar or Lord?
Decide wisely...

Comments

  • Aaron LAaron L Posts: 596 New member
    Hi Stephen,

    Thanks for letting us know about this - it looks like it was a knock on from the bug fix for the issue reported here. We were previously using the entire script but that meant we also included errors outside the selection so we changed it so it to only considered the selected text which results in what you're seeing. We'll see if there's a middle ground between the two.

    Thanks,
    Aaron.
  • Aaron LAaron L Posts: 596 New member
    We've just released 6.5.0.323 which should have this fixed in. Please let us know if you have any problems.

    Thanks,
    Aaron.
  • PDinCAPDinCA Posts: 642 Silver 1
    Did that also fix the double-semicolon issue that occurs if you ask for consecutive format SQL operations on the still-highlighted chunk?
    Jesus Christ: Lunatic, liar or Lord?
    Decide wisely...
Sign In or Register to comment.