Cross-Post: Using T-SQL to Bulk-Migrate Databases from On-Premises SQL Server to Windows Azure SQL Database

Editor’s note: This is a cross-post written by Samuel Lester,  SQL Tester. 

While many options exist to migrate your On-Premise SQL Server to Windows Azure SQL Database, none currently provide an easy method to perform bulk migration for large numbers of databases.  Using T-SQL and the Data-Tier Application Framework, the blog entry outlines the first step of the migration, extracting all databases to .bacpac files.  The T-SQL script dynamically builds and executes sqlpackage.exe command line calls to selectively loop through all databases and extract all valid SQL Databases, while providing an error list for those databases with unsupported objects in SQL Database. 

Stay tuned, as Samuel is planning follow-up blog entries to add to this series that will highlight additional bulk migration steps and techniques