database - Revert backup table data to original table SQL -
i have created backup country table.
create table country_bkp select * country; what sql should use restore country table it's original state? can do
insert country select * country_bkp; but have duplicate entries , fail primary key same .
is there sql command merge data back?
last alternative be
drop table country; create table country select * country_bkp; but want avoid grants/permissions lost this.
other cleaner way be
delete country ; insert country select * country_bkp; but looking more of merge approach without having clear data original table.
instead of dropping table, which, noted, lose permission defitions, truncate remove data, , insert-select old data:
truncate table country; insert country select * county_bkp;
Comments
Post a Comment