IF NOT EXISTS
(
	SELECT *
    FROM   INFORMATION_SCHEMA.COLUMNS
    WHERE  TABLE_NAME = 'tblTable01'
    AND COLUMN_NAME = 'Column01'
) 
BEGIN
	ALTER TABLE dbo.tblTable01
	ADD Column01 int; 
END
ELSE PRINT 'COLUMN Column01 EXISTS IN THE TABLE tblTable01'
GO
Last modified: May 13, 2019

Author

Comments

Write a Reply or Comment