I want to add an extra column to a database table if the column in the table does not yet exists. Basically I am using the approach below. My actual alter statement is not shown. Is this approach ok, or are there any shortcomings. Is there a way to make it better?
IF COL_LENGTH('Customers','lastPurchaseDate') IS NOT NULL
PRINT 'ADD ALTER STATEMENT HERE' -- I will add my alter statement here to create column lastPurchaseDate