Check Whether a Table Exist or Not in SQL Server Database

In some cases we need to identify whether a table is exist or not in a SQL server database. This is very simple & now i am sharing with you. Hope it will works like a handbook for you.

Check Table Exist or Not Query SQL Syntax:

IF EXISTS (SELECT 1 
    FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_TYPE='BASE TABLE' 
    AND TABLE_NAME='your_table_name') 
        SELECT 'Table Exists.' 
ELSE 
        SELECT 'Table does not Exist.'

Hope it will help you.

Posted in Database, SQL Server

Leave a Reply

Your email address will not be published. Required fields are marked *

AlphaOmega Captcha Classica  –  Enter Security Code
     
 

*