ap_compare_tables_sp

While the idea of this procedure is of general nature, it is designed for internal use in AbaPerls. When you load a .tbl file and the table already exists in the database and cannot be dropped because there already is data, AbaPerls loads the table defintion in the file into a temporary schema and then uses this procedure to compare the tables. The procedure compares the table, and if they are different, the procedure either raises an error, or attempts to use ALTER TABLE or similar commands to propagate the changes.

 

Note that the procedure requires the tables to be in different schema. (The ALTER TABLE plot would not work if they were in the same schema, as constraint names would collide.)

 

Parameters:

@left nvarchar(255) - the table in the temp schema.

@right nvarchar(255) - the existing table in the database.