terrydiederich2
1/10/2019 - 2:55 PM

Check if Column Exists

Use Information_Schema to see if the column exists. This could be used for update scripts when adding new columns to tables.

SELECT *
	FROM INFORMATION_SCHEMA.COLUMNS
    WHERE
      (table_name = 'product')
      AND (column_name = 'TireSizeID')
	  AND TABLE_SCHEMA = (SELECT DATABASE());