I need some SQL that checks if the column name exists and if so adds a '_2' to the end of the name. I am pulling the data from excel files, and there are a few instances where the excel headers are identical. So it might have Name, Number, Address, Address. So when I create the table I want the second one to be Address_2. But I have hundreds of these files so I am looking for a quick fix in the SQL when creating the table.
Maybe something like this:
CREATE Table X(
IF EXISTS colName (colName_2) (varchar 200)
colName (varchar 200)
)