Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any single sql command to export entire database from one sql server to another?

I was asked in the interview tell me the different ways of exporting database from one sql server to another, I knew only about creating a .bak file and then restoring it to another sql server which I told them. However, they asked me about a single SQL INSERT command which will perform this task.

I have googled it and can not find it. Please tell me if there is any such command ?

like image 679
teenup Avatar asked Dec 16 '22 22:12

teenup


1 Answers

I have never heard of such a command and this is the MS support article that tells you how to move database between servers. It gives three options none of which are a single insert statement, the closest is using sp_detach_db and sp_attach_db.

like image 52
Ben Robinson Avatar answered Dec 28 '22 07:12

Ben Robinson