I'm curious if there is a way to pass in a list of column names and possibly table names too instead of just using one of each in the code below. Thanks in advance for any help!
IF EXISTS(select * from sys.columns where Name = N'myColumn' and Object_ID = Object_ID(N'myTable')) begin -- Column Exists PRINT N'The column exists'; end ELSE -- Column doesn't exist PRINT N'The column doesn''t exist'; GO