From d90c55249ec3b5bfd02ee7fb1402e373d71ff1c3 Mon Sep 17 00:00:00 2001 From: Jason Horner Date: Tue, 2 Dec 2025 10:48:11 -0700 Subject: [PATCH] Update pre-post-deployment scripts documentation Added notes on managing SQL scripts in SDK-style projects. --- .../concepts/pre-post-deployment-scripts.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/tools/sql-database-projects/concepts/pre-post-deployment-scripts.md b/docs/tools/sql-database-projects/concepts/pre-post-deployment-scripts.md index 7a106b680fa..812b02566dc 100644 --- a/docs/tools/sql-database-projects/concepts/pre-post-deployment-scripts.md +++ b/docs/tools/sql-database-projects/concepts/pre-post-deployment-scripts.md @@ -62,6 +62,21 @@ Those files should be excluded from the database model build by setting the `Bui ``` +In SDK-style SQL projects, adding a `Build Remove="path\file.sql"` entry removes the file from the project entirely, which causes it to no longer appear in the Visual Studio Code project view. To keep the file visible while still excluding it from model compilation, add it again as a `None` item: + +```xml +... + + + + + + + +``` + +This prevents the file from being compiled as part of the database model while keeping it visible in the project. + > [!TIP] > You can validate the pre-deployment and post-deployment scripts after project build, by changing the `.dacpac` file extension to `.zip` and unarchiving the `.zip` to a folder. A single `.sql` file is present for pre-deployment and post-deployment scripts, and should contain the entire Transact-SQL contents of all referenced files in the originating SQL project.