Sql Server add culumn if not exist
Generic script for adding a column if not already existing in database.
IF NOT EXISTS ( SELECT *
FROM [dbo].syscolumns
ID = OBJECT_ID(N'[dbo].tableName')
AND NAME = N'culumnName')
BEGIN
ALTER TABLE dbo.tableName
ADD
culumnName decimal NULL
END
No comments:
Post a Comment