sqlpackage vs sqlcmd

sqlpackage is a tool that allows us to deploy sqlproj/dacpac/bacpac files across different platform such as windows, linux. It uses a slightly different sqlproj format - removing some of the dependencies sqlproj has on msbuild. 

Unfortunately it cannot be used for ispac / ssis packages. 

I was abit confused when the docs mentioned SqlAzureDacpacDeployment - giving me the impression that sqlpackages is readily available as an azure devops task.  Upon some googling - this tasks uses sqlcmd. 

The differences between sqlpackage and sqlcmd are highlighted below:- 


Key Differences

FeatureSqlPackagesqlcmd
Primary PurposeDatabase schema and data management (DACPAC/BACPAC).SQL script execution and database interaction.
Typical Use Cases- Deploying database schemas.
- Extracting or exporting schemas and data.
- Publishing database updates.
- Running ad hoc T-SQL commands.
- Automating scripts for database tasks.
- Querying or modifying data directly.
Input/OutputWorks with DACPAC/BACPAC files.Works with raw T-SQL scripts or queries.
AutomationBest for CI/CD pipelines for schema deployments.Best for running routine tasks or ad hoc queries.
Cross-PlatformYes.Yes.





Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm