SqlProjectSync 0.4.2

dotnet add package SqlProjectSync --version 0.4.2
                    
NuGet\Install-Package SqlProjectSync -Version 0.4.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SqlProjectSync" Version="0.4.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SqlProjectSync" Version="0.4.2" />
                    
Directory.Packages.props
<PackageReference Include="SqlProjectSync" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SqlProjectSync --version 0.4.2
                    
#r "nuget: SqlProjectSync, 0.4.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SqlProjectSync@0.4.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SqlProjectSync&version=0.4.2
                    
Install as a Cake Addin
#tool nuget:?package=SqlProjectSync&version=0.4.2
                    
Install as a Cake Tool

SqlProjectSync

Pull a SQL Server database's schema into a SQL database project (.sqlproj). Modern Microsoft.Build.Sql SDK-style projects are the first-class target; legacy SSDT .sqlproj files are supported on a best-effort basis.

All schema-compare and project-publish operations go through the public DacFx APIs (SchemaCompareProjectEndpoint and SchemaComparisonResult.PublishChangesToProject), so the tool needs no Visual Studio, vswhere, MSBuild discovery, or hand-rolled folder-structure tables.

Install

dotnet tool install --global SqlProjectSync.Tool

CLI

sqlproj-sync sync <scmp-path> [--preview] [-v <verbosity>] [--folder-structure <layout>]

Examples:

# Preview what would change
sqlproj-sync sync ./CompareToProject.scmp --preview

# Apply changes with debug logging
sqlproj-sync sync ./CompareToProject.scmp -v Debug

# Pick a different DacFx folder layout (default: SchemaObjectType)
sqlproj-sync sync ./CompareToProject.scmp --folder-structure Schema

Options:

Flag Default Meaning
--preview off Print the projected changes without writing to disk.
-v, --verbosity Information One of Trace, Debug, Information, Warning, Error, Critical, None.
--folder-structure SchemaObjectType DacFx DacExtractTarget — controls how files are laid out in the project.

The .scmp file is the same shape as the one Azure Data Studio / SqlPackage produce; the tool resolves the target .sqlproj by walking up directories from the .scmp and matching ProjectBasedModelProvider.Name.

Exit codes: 0 success (or no differences), 1 schema sync failed, 2 comparison returned an invalid state.

Library

using SqlProjectSync;

var comparison = SchemaSync.Compare("CompareToProject.scmp");
if (comparison.IsEqual)
{
    Console.WriteLine("Already in sync.");
    return;
}

var publish = SchemaSync.Apply(comparison);
foreach (var added in publish.AddedFiles)   Console.WriteLine($"+ {added}");
foreach (var del   in publish.DeletedFiles) Console.WriteLine($"- {del}");
foreach (var chg   in publish.ChangedFiles) Console.WriteLine($"~ {chg}");

Pass a SyncOptions record to override the target project path, the source connection string, the DSP, or the folder structure. Pass an ILogger to capture structured progress events.

Status

Phases 0 – 6 are landed. See PLAN.md for what each phase covered and the per-phase follow-on items.

The legacy .sqlproj compat suite (in tests/SqlProjectSync.IntegrationTests/LegacyCompatTests.cs) runs as part of the default dotnet test. DacFx's PublishChangesToProject only writes/deletes the .sql files; the matching <Build Include="..."/> items in the legacy XML are patched afterwards by LegacyProjectPatcher using the preview Microsoft.SqlServer.DacFx.Projects package. The nightly legacy-compat.yml workflow still runs the suite with continue-on-error: true as a defensive net.

Building from source

dotnet build -c Release SqlProjectSync.slnx
dotnet test  -c Release tests/SqlProjectSync.Tests/SqlProjectSync.Tests.csproj
dotnet test  -c Release tests/SqlProjectSync.IntegrationTests/SqlProjectSync.IntegrationTests.csproj -- --filter-not-trait Style=Legacy
dotnet pack  -c Release src/SqlProjectSync/SqlProjectSync.csproj -o artifacts
dotnet pack  -c Release src/SqlProjectSync.Tool/SqlProjectSync.Tool.csproj -o artifacts

Integration tests require Docker (a SQL Server 2022 container is spun up per test session via Testcontainers). Unit tests have no external dependencies.

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.2 77 5/15/2026
0.4.1 31 5/15/2026
0.4.0 35 5/15/2026
0.3.0 40 5/15/2026
0.2.1 60 5/13/2026
0.2.0 54 5/12/2026
0.1.0 41 5/12/2026