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

DROP TABLE IF EXISTS dbo.MyTable flagged as invalid

I'm getting an error from SQL Prompt when I try and format my SQL, yet the SQL runs Ok ...

The error is from the statement ...
DROP TABLE IF EXISTS dbo.MyTable

This is with SQL Prompt v7.2.0.260
steveculshaw
0

Comments

6 comments

  • Ali D
    Hi Steve

    You’re correct but unfortunately the formatting system in v7.2 doesn’t fully support SQL Server 2016 syntax.

    The upcoming v7.3 beta’s formatting system will support this syntax but since IF EXISTS is quite simple I’ll look into adding support for it in v7.2 now.

    Thanks
    Ali
    Ali D
    0
  • steveculshaw
    Thanks for the prompt response
    steveculshaw
    0
  • Ali D
    Hi Steve

    I’ve had a look at supporting IF EXISTS in Prompt’s current formatting system. Unfortunately, because we’re in the middle of transitioning to a new and improved formatting system, backporting syntax support at this point is quite complex.

    This new formatting system supports IF EXISTS and will be released in the next Prompt beta. Sorry for the delay.

    Thanks
    Ali
    Ali D
    0
  • hafnera
    Ali, this is still an issue and I am on 7.3. Any idea on when this will be fixed? Here is an example of what is still breaking. Thanks!

    CREATE TABLE #temp
    (
    test VARCHAR(20)
    )

    DROP TABLE IF EXISTS #temp
    hafnera
    0
  • Harry Frankish
    Hi hafnera

    I'm unable to reproduce the issue here. It might be that the new formatting feature isn't turned on. Please could you check that "SQL Prompt > Options > Labs > Experimental features > Use new formatting styles" is on?

    Many thanks
    Harry
    Harry Frankish
    0
  • hafnera
    Harry,

    Enabling the new formatting styles resolved my issue. Thanks for the resolution!
    hafnera
    0

Add comment

Please sign in to leave a comment.