>>select * into targetDb..targetTable from sourceDb..sourceTable >>>
if exists ( select * from sys.tables where [name] = 'MyTarget' and is_ms_shipped = 0 ) begin insert into myTarget select * from mySource; end; else begin select * into myTarget from mySource; end;Or use DROP if you want to create afresh:
if exists ( select * from sys.tables where [name] = 'MyTarget' and is_ms_shipped = 0 ) begin drop table myTarget; end; select * into myTarget from mySource;Of course this is oversimplified version. You need to take care of primary key violations and such. IMHO you shouldn't even try this if you are not fluent in T-SQL and get help from DBA. There are also tools like RedGate's SQLCompare, that checks the data structure differences, SQL Data Compare, SQLBackup (SQL Toolbelt in short).