IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'TableName' AND COLUMN_NAME = 'ColumnName') BEGIN -- alter table or other query -- . . . END
Friday, 5 August 2011
Checking if a Column Does Not Exist on a Table
Labels:
SQL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment