4 August, 2009
0 Comments
1 category
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
Tags: SQL ServerT-SQL
Category: Uncategorized