How to check if column exists in SQL Server table
SQL Server 2005 onwards: if not exists(select 1 from sys.columns where Name = N’columnName’ and Object_ID = Object_ID(N’tableName’)) begin — Column does not exist end http://stackoverflow.com/questions/133031/how-to-check-if-column-exists-in-sql-server-table