Importing a database without the use of VS or ADS #123
-
|
Apologies ahead of time if this is the wrong place to ask this, I wasn't sure where else it should go. I've placed it in the "Ideas" category, because as far as I can tell, this feature doesn't yet exist. So in short...I'm trying to find a way to automate the process of exporting a SQL Server database into a folder format in the same way that Visual Studio SSDT and ADS SQL Projects do. When you import a database from a DACPAC or SQL Server Instance database...it will automatically create the folder structure and import everything needed into the project. Including things like Triggers, their order, database level items, permissions, etc. I cannot find how to do this for the older VS SSDT SQL Projects, but at the same time...that sounds like it would be a pain anyway because you'd still need to find a way to generate and populate the .sqlproj file. Now that we have SDK style projects which don't require a full list of included files, and the project files can be created using a Are there any future plans to support something like this? Or maybe already support for it now? A use case would be - a large company with lots of databases and they want to automate the process of creating and importing SQL projects. Rather than manually creating a new project in ADS and importing the DB, it could be scripted in PowerShell as a way to quickly bootstrap their migration to SQL projects. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
hi! In good news - this is possible. From the extract docs:
As you noted, with the SDK-style projects we can add a template to the NuGet for easily instantiating a new project. Unfortunately, this hasn't been completed just yet. cc: @zijchen |
Beta Was this translation helpful? Give feedback.
hi! In good news - this is possible.
The functionality you're looking to do (take a database schema out into files) is the SqlPackage extract command with the /p:ExtractTarget property set to
ObjectType,Schema, orSchemaObjectType.From the extract docs: