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

Missing Semicolon

Hi Redgate Team,

SQL Prompt is not adding semicolons:
DROP TABLE IF EXISTS file_statistics_3;
DROP TABLE IF EXISTS file_size_3  -- missing one
DROP TABLE IF EXISTS waits_3  -- missing one
GO

Would be nice if you can fix this!

Thanks!

Torsten
torsten.strauss
0

Comments

11 comments

  • Grant
    Did that happen while typing or while formatting. I just tested it and it put the semicolons in the right spot during formatting.
    Grant
    0
  • torsten.strauss
    Hi Grant.

    During formatting.
    I will send the version number tomorrow and hopefully some more details.

    Thanks for looking into this.

    Torsten
    torsten.strauss
    0
  • torsten.strauss
    Hi Grant,

    Version is 9.0.6.3580 .
    Even if I force SQL Prompt to add missing semicolons (CTRL B, (CTRL C) it does not work.

    Torsten
    torsten.strauss
    0
  • Grant
    Interesting. I'm a little behind you on updates, 9.0.4, but it's working there. I'll get updated and see what happens.
    Grant
    0
  • torsten.strauss
    Hi Grant!

    Yes, you are right! I worked already in previous versions as I remember ...
    torsten.strauss
    0
  • Grant
    Nuts. I can't replicate it. I'm still getting semi-colons. What version of SSMS or VS?
    Grant
    0
  • torsten.strauss
    SSMS 14.0.17213.0
    torsten.strauss
    0
  • Grant
    Well I'm at a loss. I'm on the same version of SSMS and it's working every time I try it.

    Are there additional scripting elements before the example? I know that if there are scripts that contain errors it sometimes won't put semi-colons in. I also hit issues sometimes on giant scripts (I'm working on a couple of books and the scripts are enormous, sometimes formatting is pretty unhappy with me). Are these part of a multi-thousand line script?
    Grant
    0
  • torsten.strauss
    Hi Grant,

    it seems that there is something in the code itself which causes the issue.

    I attached my script and you can see that SQL Prompt will raise an error in line 608 - 619 because of DBCC PAGE(BulkLogged, 1, 7, 3) WITH TABLERESULT if you format the entire script but if you highlight the Housekeeping section line 501-515 and just try to add the missing semicolons CTRL B + C nothing happens ...

    It is bit wired ;)

    Torsten

    I attached the script
    torsten.strauss
    0
  • way0utwest
    I loaded the script, and as you can see, it formats semicolons for me fine. I do see an issue with DBCC PAGE, but not semi colons. I don't have SSMS 14, but this does seem to work in ssms 17.4

    gx36ud4rpqb1.gif
    way0utwest
    0
  • torsten.strauss
    Hi Grant.

    Strange.
    Can we have a quick call tomorrow?
    I had a chat with redgate today and still can use the join.me session...

    Thanks

    Torsten
    torsten.strauss
    0

Add comment

Please sign in to leave a comment.