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

BUG: Formating queries fails if GO statement is not on a line of its own

Hi
It seems that the formatting fails when there is a GO statement on the same line as another query. 
I get an error trying to format the following query:

SELECT * FROM Felles.DimAlder da; GO 

I am on version 10.13.8.680 on SSMS 19
gerthauan
0

Comments

2 comments

  • Jon_Kirkwood

    Hi @gerthauan

     Thank you for reaching out on the Redgate forums.

     This looks to be expected behaviour in handling a GO command on the same line as a T-SQL statement.

     

    From Microsoft;

    A Transact-SQL statement cannot occupy the same line as a GO command. However, the line can contain comments.

    Link

     Running your command without SQL Prompt brings up the same error directly in SSMS.

     


    I don't believe this is a bug in SQL Prompt but a genuine error passed through from SSMS

    Jon_Kirkwood
    0
  • gerthauan
    Yeah, I was aware of that. Was just hoping that SQLPrompt would be able to format some stuff before parsing it. I sometimes get queries in one long line of code that would be nice to be able to format. Thanks anyway.
    gerthauan
    0

Add comment

Please sign in to leave a comment.