Home Forums Programming SMO/RMO/DMO Script difference between two databases RE: Script difference between two databases

  • You can search information_schema.columns in both systems, order by name, and the compare to see which columns are in the tables, or which ones aren't.

    Then you can use an ALTER TABLE command (or the SMO equivalent) to change the table.

    I'm not sure why you would put this in an application. Are you changing schema very often or is this just an exercise? The issues are that there could be defaults, rules, constraints, etc. imposed on a column. It's a simple process, but it has a lot of moving parts and it's easy to make mistakes. That's why a tool from someone like Apex or Red Gate is worth a few hundred dollars.