IF NOT EXISTS (select * from syscolumns where id=object_id('[table_name]') and name='[column_name]') alter table [table_name] add [column_name] [column_definition>]
Thursday, March 4, 2010
Column Exists before creating
I do not know why, but I have trouble remembering how to check if a SQL Server Column exists before trying to add it. Here it is:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment