Folks,
How do you handle columns in a smart way?
Let's say I have a script and a table.
Script creates some columns in it.
While I work on script, I run it many times on a table. When script creates column, it ends up in creating many columns with the same name but different number. If I refer to created column by name later in the script, it would refer to the old columns (like "New Column", but not "New Column 23").
The way to deal with that is to delete a column with that name before actually creating. Problems starts when first using that script on fresh table - when there is no column to delete....
Anyways, how would you realize the smart column adding?
Some like:
I want to create a new column with this name. Is there any columns with this name or name that is this name and a number (dublicate columns)? If yes, then delete them and create my column. If there is no such columns, just create a new column with this name...