Search code examples
sql-serverdatabaseazure-sql-databasesql-server-ce

Create Azure Sql Database from Sql Compact sdf file


I need to create an Azure Sql Database from a Sql Compact sdf file. I see that you can create a BACPAC file from a Sql Server database, upload the BACPAC to Azure blob storage, and then create the Azure Sql Database from the BACPAC, but I do not see how to do this via a Sql Compact database. Is there a way to create a BACPAC from Sql Compact? Ideally I would not want to convert the Sql Compact to Sql Server and then create the BACPAC.

If going the BACPAC route is not the best means of creating an Azure Sql Database from a Sql Compact file then what is the next best option? I have also found some tools that will create the sql create/insert scripts from the sdf file, but running the script locally to create a populate an Azure Sql Database is extremely slow.


Solution

  • The next best option is to use my SQL Server Compact Toolbox Visual Studio extension to script the SQL Compact database for Azure, which will generate scripts that are optimized for Azure (using batching of INSERTs)

    If that is still too slow, boot up an Azure VM near your Azure database, and run the scripts from it.