You may want to check if a column exists before adding the column or performing some action on that column. Here is the clause to check column existence.
IF EXISTS (SELECT * FROM SysObjects O INNER JOIN SysColumns C ON O.ID=C.ID WHEREObjectProperty(O.ID,'IsUserTable')=1 AND O.Name='TableName' AND C.Name='ColumnName')
No comments:
Post a Comment