Options

DROP TABLE IF EXISTS dbo.MyTable flagged as invalid

steveculshawsteveculshaw Posts: 16 Bronze 2
edited January 20, 2017 2:26PM in SQL Prompt
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
Cheers,
SteveC.

Comments

  • Options
    Ali DAli D Posts: 56 New member
    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
  • Options
    steveculshawsteveculshaw Posts: 16 Bronze 2
    Thanks for the prompt response
    Cheers,
    SteveC.
  • Options
    Ali DAli D Posts: 56 New member
    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
  • Options
    hafnerahafnera Posts: 16 New member
    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
  • Options
    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
  • Options
    hafnerahafnera Posts: 16 New member
    Harry,

    Enabling the new formatting styles resolved my issue. Thanks for the resolution!
Sign In or Register to comment.