Thursday, 7 March 2013

MS SQL - Check if table exists

Check if table exists
if Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='TableName')
begin
            Select * FROM TableName
else

No comments:

Post a Comment