简体   繁体   中英

How do I generate the DDL file need for Azure Synapse Pathways

I'm trying to recreate an Azure SQL database in Azure Synapse. To this end I use SSMS to generate the various create tables script, then use the "Azure Synapse Pathways" tool to convert that script to a Synapse compatible script, but this unfortunately results in many errors and the resultant scripts are unusable. The errors are many and varied, but for example:

TEXTIMAGE ON not supported CLUSTERED PRIMARY KEY not supported CHECK constraint not supported FOREIGN KEY not supported

Is there a way to generate DDL file, such that Azure Synapse Pathway has a better chance of converting the script?

I have done this recently and used Visual Studio Database projects to aid the conversion. Do the following steps in Visual Studio 2019:

  1. create a new SQL Server Database project

SQL Server 数据库项目

  1. set the Target platform to 'Microsoft Azure SQL Database' in the project properties

目标平台

  1. Import the database to the project. Follow the instructions from here

  2. Fix any errors that are reported

  3. Change the target platform to 'Microsoft Azure SQL Data Warehouse'

  4. Fix any errors that are reported. Dedicated SQL pools only supports NONCLUSTERED and NOT ENFORCED primary keys for example

  5. Publish your project to the target Synapse server

  6. I ended up re-importing the database to a new database project for a 'clean' schema. YMMV

You can also script out SQL from SQL Server Management Studio (SSMS) in a dedicate SQL pool format or look at command-line tools like mssql-scripter and mssql-cli command line. Pathway is in preview and I just had too many issues with it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM