An error appear when I use "DROP TABLE IF EXISTS" in SSMS v.17.1

Viewed 21930

I am working with the version v.17.1 of the SQL Server Management Studio. And theoretically, the query DROP TABLE IF EXISTS works from SQL Server 2016.

You can see this in the official web page of Microsoft: DROP TABLE

However, when I try to execute the query

DROP TABLE IF EXISTS dbo.EmpLocations;

an error appears:

Incorrect syntax near the keyword 'IF'.

What is the problem? I'm using a specific database of Microsoft to work with SQL Server 2016 - 2017.

3 Answers
Related