Hi @techresearch7777777 ,
Firstly, using the Export Data wizard can cause a significant increase in the transaction log size on both VM_1 and VM_2. This is because the wizard reads data from VM_1 and writes it to VM_2 using a single transaction, which can result in a large transaction log. You can mitigate this by using the "Fast Load" option in the wizard, which minimizes logging during the transfer.
Secondly, the Export Data wizard may not be the most efficient method for large data sets, especially if the transfer needs to run for hours. In this case, it may be better to use a bulk copy program, such as the bcp utility, to export the data to a flat file and then import it into the destination database. This method can be faster and less resource-intensive, but it does require more manual configuration.
Ultimately, the best method depends on your specific requirements and the size of the data set. If you have a small to medium-sized data set and want a simple, easy-to-use method, the Export Data wizard can be a good choice. If you have a large data set and need more control over the transfer process, bcp or another bulk copy program(SSIS) may be more suitable.
Best regards,
Seeya
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
You can use the queryout option with BCP:
BCP "SELECT ... FROM db.dbo.tbl WHERE .." queryout file.bcp -n -T -S Server
You could also set up a view and run bcp from the view, which makes the bcp command line sleaker.
Hi @techresearch7777777 ,
If you still want to use bulk insert, here is a sample for your reference. You can change the options and parameters to suit your needs.
Best regards,
Seeya
If the answer is the right solution, please click "Accept Answer" and kindly upvote it.
Sounds like from your sample 1st step would be to bulk export ALL the Table's data and then use your BULK INSERT with WHERE clause to filter out only needed rows...
A two step process?
Thanks Seeya Xi-MSFT
Sign in to comment