If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I am trying to check if a column exists in a table. If the column does not exist then I want to alter the table so I can add it, if it does exists then I want to do nothing. Any help would be appreciated.

Are you doing this for an upgrade script? You can just try to add the column and if it fails then it already exists. When we add columns or Foriegn keys we add them one at a time in our sql script so that if they aren't already there then they get added.

I also want to do the same thing for adding column, changing datatype, adding table etc. Is their nice way to do this and check if it already exists in the datbase. This will be at the customer site so will not be able to do describe etc.