|
| 1 | +--- |
| 2 | +title: Use SDK-style projects with the SQL Database Projects extension |
| 3 | +description: Getting started using SDK-style SQL projects with the SQL Database Projects extension for Azure Data Studio or VS Code |
| 4 | +ms.prod: azure-data-studio |
| 5 | +ms.technology: azure-data-studio |
| 6 | +ms.topic: conceptual |
| 7 | +author: dzsquared |
| 8 | +ms.author: drskwier |
| 9 | +ms.reviewer: maghan |
| 10 | +ms.custom: |
| 11 | + - intro-get-started |
| 12 | +ms.date: 5/24/2022 |
| 13 | +--- |
| 14 | + |
| 15 | +# Use SDK-style SQL projects with the SQL Database Projects extension (Preview) |
| 16 | + |
| 17 | +This article introduces [Microsoft.Build.Sql](https://www.nuget.org/packages/Microsoft.Build.Sql) for SDK-style SQL projects in the SQL Database Projects extension in Azure Data Studio or VS Code. SDK-style SQL projects are especially advantageous for applications shipped through pipelines or built in cross-platform environments. The initial announcement is available in [TechCommunity](https://techcommunity.microsoft.com/t5/azure-sql-blog/microsoft-build-sql-the-next-frontier-of-sql-projects/ba-p/3290628). |
| 18 | + |
| 19 | +> [!NOTE] |
| 20 | +> The SDK-style SQL projects is currently in preview. |
| 21 | +
|
| 22 | +## Create an SDK-style database project |
| 23 | + |
| 24 | +You can create an SDK-style database project from a blank project, or from an existing database. |
| 25 | + |
| 26 | +### Blank project |
| 27 | + |
| 28 | +In the **Projects** view, select the **New Project** button and enter a project name in the text input that appears. In the **Select a Folder** dialog box that appears, choose a directory for the project's folder, `.sqlproj` file, and other contents to reside in. |
| 29 | + |
| 30 | +By default the selection for **SDK-style project (Preview)** is checked. When the dialog is completed, the empty project is opened and visible in the **Projects** view for editing. |
| 31 | + |
| 32 | +### From an existing database |
| 33 | + |
| 34 | +In the **Project** view, select the **Import Project from Database** button and connect to a SQL Server. Once the connection is established, select a database from the list of available databases and set the name of the project. Select a target structure of the extraction. |
| 35 | + |
| 36 | +By default the selection for **SDK-style project (Preview)** is checked. When the dialog is completed, the new project is opened and contains SQL scripts for the contents of the selected database. |
| 37 | + |
| 38 | +## Build and publish |
| 39 | + |
| 40 | +From the Azure Data Studio and VS Code interfaces, building and publishing an SDK-style SQL project is completed in the same way as the previous SQL project format. For more on this process, see [Build and Publish a Project](sql-database-project-extension-build.md). |
| 41 | + |
| 42 | +To build an SDK-style SQL project from the command line on Windows, macOS, or Linux, use the following command: |
| 43 | + |
| 44 | +```bash |
| 45 | +dotnet build /p:NetCoreBuild=true |
| 46 | +``` |
| 47 | + |
| 48 | +The `.dacpac` resulting from building an SDK-style SQL project is compatible with tooling associated with the data-tier application framework (`.dacpac`, `.bacpac`), including [SqlPackage](../../tools/sqlpackage/sqlpackage-publish.md). |
| 49 | + |
| 50 | + |
| 51 | +## Next steps |
| 52 | + |
| 53 | +- [Build and Publish a project with SQL Database Projects extension ](sql-database-project-extension-build.md) |
0 commit comments