Reputation: 1362
We have some sets of the tables in same database like table1 and table_copy. Now we are planning to migrate the old data from table1 to table_copy which is currently in use. But before that we have to compare the definitions of the tables so that the data import will be hassel free. Can we compare the table definitions with a sybase query.
I searched over net by all I get approaches to compare the data in two tables. but we intend to compare the definitions only.
Upvotes: 0
Views: 703
Reputation: 524
You could do queries on sysobjects, syscolumns and systypes. Or you could compare with diff (or perl or whatever) the outputs of sp_help. However isn't this really a development and testing problem? You should perhaps copy the database into a pre-production database and test your scripts - repeat until perfect. If you can only do the full migration on the Production database for some resources reason (time, money, servers,) then you need full dumps before starting. Isn't the DDL for these two tables saved and accurate in a Version Control system somewhere? Perhaps they're from a 3rd party system though, so you don't have that.
Upvotes: 1