Please visit my new Web Site https://coderstechzone.com
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.
Query:
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='tablename') SELECT 'table exists.' ELSE SELECT 'table does not exist.'
Hope it will help you.
0 comments:
I WOULD BE DELIGHTED TO HEAR FROM YOU