locked
Microsoft.SqlServer.Dac Slow - Parallel Import RRS feed

  • Question

  • Hello,

     I'm trying to write an application that will automate the import of my on-premises SQL Server database to Azure SQL.  I am using the Microsoft.SqlServer.Dac DACFx and can get everything to work properly except it's really slow when importing the actual data when compared to using SQLPackage which runs some of the data copy operations in parallel.  

    Does anyone know if there is a way to have multiple data copy operations to be running in parallel when calling the ImportMacpac method? 

    var CSBImport = new System.Data.SqlClient.SqlConnectionStringBuilder(@"CONNECTION STRING HERE");
    var DAC = new Microsoft.SqlServer.Dac.DacServices(CSBImport.ConnectionString);
    var Package = Microsoft.SqlServer.Dac.BacPackage.Load(@"PATH TO .bacpac");
    DAC.ImportBacpac(Package, "RestoreTest", null);

    Friday, October 26, 2018 7:43 PM

All replies

  • Hello,

     I'm trying to write an application that will automate the import of my on-premises SQL Server database to Azure SQL.  I am using the Microsoft.SqlServer.Dac DACFx and can get everything to work properly except it's really slow when importing the actual data when compared to using SQLPackage which runs some of the data copy operations in parallel.  

    Does anyone know if there is a way to have multiple data copy operations to be running in parallel when calling the ImportMacpac method? 

    var CSBImport = new System.Data.SqlClient.SqlConnectionStringBuilder(@"CONNECTION STRING HERE");
    var DAC = new Microsoft.SqlServer.Dac.DacServices(CSBImport.ConnectionString);
    var Package = Microsoft.SqlServer.Dac.BacPackage.Load(@"PATH TO .bacpac");
    DAC.ImportBacpac(Package, "RestoreTest", null);

    Good day Ryan,

    1. There is a phrase that says "you can find the relation between any two entities" (usually it is talking about any two people).

    You can find the relation of your question to Azure SQL Database but your question really related to Azure SQL Database but to the developing side in my opinion. I recommend to ask the question in a forum where people focus on the labguage which you use (I assume that this is vb.net but the code is too short to be sure)

    2. Microsoft.SqlServer.Dac Namespace provides classes which fit well for local use, but I do not recommend this approach in most cases when you execute your client app and your package remotely from the server.

    In this case, I would recommend a different approach which is working in 2 steps: (1) upload the package to the blob (2) import the package from the blob

    I highly recommend to go over the following blog.Please check if this help you in someway:
    https://blogs.msdn.microsoft.com/sqlcat/2016/10/20/migrating-from-sql-server-to-azure-sql-database-using-bacpac-files/


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]
    • Edited by pituachMVP Sunday, October 28, 2018 6:03 AM
    Sunday, October 28, 2018 6:02 AM