How to Check if the table exists in SQL Server ?

Published on December 13, 2013 by abundantcode

Filed under SQL Server

Last modified December 13, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 3480 times

Do you want to know if the table exists in a in SQL Server ? . Below is a sample query that lets you know if the table exists or not.

How to Check if the table exists in SQL Server ?

Assume that the table name is Employee , run the below query to know if the table exists in the SQL Server or not.

IF ( EXISTS (SELECT *
   FROM INFORMATION_SCHEMA.TABLES
   WHERE TABLE_NAME = 'Employee'))
   BEGIN
     SELECT 'AC table found'
   END
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


x

You might be Interested in these Posts

How to Perform Inner Join using LINQ in C# ?

Are you looking for the syntax on how to perform inner join using LINQ in C# ? . Below is a sample c...

How to Add a Column with Default Value to Existing Table in SQL Server ?

Looking to add a column with default value to an existing table in SQL Server ? Below is an example ...

How to Programatically Check if the Location Services is Turned On or Off in Windows Phone 8 ?

Below is a sample code snippet that demonstrates how to programmatically check if the Location Servi...