none
Azure Germany - Cannot import SQL database anyhow RRS feed

  • Question

  • Hello.

    We are unable to import any BACPAC into the Azure SQL server by any way.

    What we tried:

    • Import using Powershell commands New-AzSqlDatabaseImport, New-AzureRmSqlDatabaseImport
    • Import using Portal
    • Import using MS SQL Management Studio

    The BACPAC should be correct, as it is exported from the same SQL server using New-AzSqlDatabaseExport command and can be imported into local SQL Express server.

    It always (in all ways tried) by following error:

    Could not import package.
    Error SQL72014: .Net SqlClient Data Provider: Msg 42019, Level 16, State 9, Line 1 CREATE DATABASE operation failed. Please retry.
    Error SQL72045: Script execution error.  The executed script:
    CREATE DATABASE [$(DatabaseName)] COLLATE SQL_Czech_CP1250_CS_AS
        (EDITION = 'Standard', SERVICE_OBJECTIVE = 'S0', MAXSIZE = 2 GB)
        WITH CATALOG_COLLATION = SQL_LATIN1_GENERAL_CP1_CI_AS
     (Microsoft.SqlServer.Dac)

    What can be wrong here? It worked until week before, but suddenly it is failing. 


    Zoka


    • Edited by zoka_ml Thursday, July 18, 2019 11:12 AM title changed
    Thursday, July 18, 2019 11:09 AM

Answers

  • Hello.

    Thanks for the tips. Without any change from my side, the same code started to work again.

    I'm 100% sure it was not the issue with database name:

    • The script copy database (on Azure SQL to the same server), make backup (BACPAC), and copy to Storage. Finally it deletes copied database
    • It is run every day at same time. 
    • It was failing for about 14 days sporadically (few times I have manually checked for database existence)
    • It failed after around 40minutes on the first step with message mentioned above.
    • For about 10 days now it runs with no error, without any change from my side

    So again, thanks for your help, but the problem solved itself - and hopefully it won't appear again.

    Best regards,
    Michal Linhart


    Zoka

    Monday, July 29, 2019 8:59 PM

All replies

  • Hi,

    While importing from SQL Server to SQL Azure, there will be some compatibility issues. Hence we earlier created queries for both DB and data and executed on SQL Azure. Please give a try with this.

    https://dzone.com/articles/generate-database-scripts-with-data-in-sql-server


    -Malleswar



    Thursday, July 18, 2019 12:20 PM
  • Thanks for answer, but this is not the issue.

    The BACPAC is created using New-AzSqlDatabaseExport  from Powershell. Importing this BACPAC on the same Azure SQL Server, it was exported from, fails. It is not BACPAC from my local database. 


    Zoka

    Thursday, July 18, 2019 12:37 PM
  • Hi,

    Did you analysis your database with Azure Migration Assistant?

    Regards


    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

    Thursday, July 18, 2019 1:02 PM
  • Hi Zoka_ml.

    This is a timeout error. Does the database (name) already exist and what user are you running attempting to login as? If it worked a week before I am assuming that it is likely an issue with the name of the database still being used somewhere.

    If it worked a week before, was this in Azure? Or locally?

    Monday, July 22, 2019 10:08 PM
    Moderator
  • Want to follow up on this to see if you require assistance. Please comment with latest to continue the dialog. 

    Thank you,

    Mike

    Monday, July 29, 2019 7:54 PM
    Moderator
  • Hi Zoka_ml.

    This is a timeout error. Does the database (name) already exist and what user are you running attempting to login as? If it worked a week before I am assuming that it is likely an issue with the name of the database still being used somewhere.

    If it worked a week before, was this in Azure? Or locally?

    The issue related to the query:

    CREATE DATABASE [$(DatabaseName)] COLLATE SQL_Czech_CP1250_CS_AS
        (EDITION = 'Standard', SERVICE_OBJECTIVE = 'S0', MAXSIZE = 2 GB)
        WITH CATALOG_COLLATION = SQL_LATIN1_GENERAL_CP1_CI_AS

    Without more information I am guessing that Mike is right and this is probably related to the database name.

    You should test this query directly using the same database name as the old version


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]

    Monday, July 29, 2019 8:41 PM
    Moderator
  • Hello.

    Thanks for the tips. Without any change from my side, the same code started to work again.

    I'm 100% sure it was not the issue with database name:

    • The script copy database (on Azure SQL to the same server), make backup (BACPAC), and copy to Storage. Finally it deletes copied database
    • It is run every day at same time. 
    • It was failing for about 14 days sporadically (few times I have manually checked for database existence)
    • It failed after around 40minutes on the first step with message mentioned above.
    • For about 10 days now it runs with no error, without any change from my side

    So again, thanks for your help, but the problem solved itself - and hopefully it won't appear again.

    Best regards,
    Michal Linhart


    Zoka

    Monday, July 29, 2019 8:59 PM
  • Hi,

    I glad to hear that you think that issue was solved.

    I do not believe in "problem solved itself". This usually means that it was not solved and it will raise again in the future. I believe in finding the source or keeping the issue as opened until you find the source.

    Anyhow, in the scope of the forum, this is all we can do :-)

    Please close the thread by marking one or more responses as answer. If there is nothing which fit as answer, then you can mark your summery as the answer. Closing the thread is important for the forum administration and to prevent other supporter to wast their time in coming into this thread and read it from start to end

    Have a great day


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]

    Monday, July 29, 2019 10:28 PM
    Moderator