MSSQL check if Table or Column Exists

Date: 2016-06-14

IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_SCHEMA = 'dbo' 
    AND  TABLE_NAME = 'Page'))
BEGIN
    PRINT 'Table exists'	
END
ELSE
BEGIN
	PRINT 'Table does not exists'	
END


IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS 
    WHERE TABLE_SCHEMA = 'dbo' 
    AND  TABLE_NAME = 'Page'
    AND COLUMN_NAME = 'State'))
BEGIN
    PRINT 'Column exists'	
END
ELSE
BEGIN
	PRINT 'Column does not exists'	
END
3150cookie-checkMSSQL check if Table or Column Exists