Drop If Exists Feature In Sql Server 2016

If you need to delete a table , then you are used to writing code like this. If the table exists it will drop.We all have been writing code like this for years.


In SQL server you can simply drop a table like this.You can use this syntax for droping indexes,databases,roles,defaults,schemas and so on
DROP TABLE IF EXISTS  dbo.Customer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s