Git Product home page Git Product logo

dacpacdeployutility's Introduction

DacpacDeployUtility

A command line utility to replace SqlPackage.exe for publishing .dacpac file to database. Also some other database tools for Microsoft SQL Server, such as

BacpacImportUtility

A command line utility to import .bacpac files into a database

DatabaseBackupUtility

A command line utility to backup a database

DatabaseKiller

A command line utility to delete a database

DatabaseRestoreUtility

A command line utility to restore database from .bak files

Why not SqlPackage.exe

The problem with SqlPackage.exe is sometimes it will keep throwing StackOverflow exception while publishing/deployment can be done successfully using Visual Studio, suggesting Visual Studio is using something different to do the publishing. With this tool, StackOverflow exception can be avoided completely.

Why not Visual Studio

Using Visual Studio to open .sqlproj and do the publishing/deployment is painfully slow and constantly freeze up, also it is a manual labour, this is true for both VS2017 and VS2019.

Usage

DacpacDeployUtility.exe [PathToPublishXmlFile] [PathToDacpacFile]

It's as simple as that.

To build the database project and generate the .dacpac file, just use MSBuild like below

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\MSBuild.exe" "[PathToDatabaseProject]\XXX.sqlproj" /t:build

this should generate the .dacpac file output in the bin\Debug folder, then this utility can be used to publish/deploy to SQL Server instance

Supported Publish XML file options

TargetDatabaseName: Required

TargetConnectionString: Required

IncludeCompositeObjects: Optional

BlockOnPossibleDataLoss: Optional

CreateNewDatabase: Optional

ScriptDatabaseCompatibility: Optional

GenerateSmartDefaults: Optional

BacpacImportUtility

There is also a BacpacImportUtility which will import/restore the .bacpac file into a empty database or a brand new one if the database doesn't exist

Usage

BacpacImportUtility.exe [ConnectionString] [PathToBacpacFile] [DatabaseName: Optional if InitialCatalog is specified in the connection string]

If the database already exists and contains user objects in it, this utility will throw exception. Beware of that.

dacpacdeployutility's People

Contributors

imgen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.