I have 2 databases on SQL (identical). I want a table from one database to be copied to the other database. They are both the same name and the original table can be overeritten.
Cheers
I have 2 databases on SQL (identical). I want a table from one database to be copied to the other database. They are both the same name and the original table can be overeritten.
Cheers
DELETE FROM `target_database`.`table_name`
INSERT INTO `target_database`.`table_name` SELECT * FROM `source_database`.`table_name`
If you want the tables in sync continuously, you can use Transactional Replication.It will keep on copying the data from one table one db to another table of other DB.
Refer for further setup details over here:
Assuming no computed columns, Identity columns or FK constraints something like the following should work.
BEGIN TRAN
DELETE FROM SixthSenseUsers.dbo.college_survey_questions
INSERT INTO SixthSenseUsers.dbo.college_survey_questions
SELECT * FROM test.dbo.college_survey_questions
COMMIT