IF COL_LENGTH('dbo.stbTable01', 'siCol01') IS NULL
BEGIN
ALTER TABLE dbo.stbTable01
ADD siCol01 smallint NOT NULL DEFAULT 0
PRINT 'column siCol01 added'
END
ELSE
BEGIN
PRINT 'column siCol01 already exist'
END
IF COL_LENGTH('dbo.stbTable01', 'siCol01') IS NULL
BEGIN
ALTER TABLE dbo.stbTable01
ADD siCol01 smallint NOT NULL DEFAULT 0
PRINT 'column siCol01 added'
END
ELSE
BEGIN
PRINT 'column siCol01 already exist'
END
Comments