Skip to content
No description, website, or topics provided.
C# TSQL PowerShell Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src/sqlscripter
test
.appveyor.yml
.gitattributes
.gitignore
README.MD
azure-pipelines.yml
deps.ps1
deps.sh
deps.url
lgtm.yml
nuget.config
sqlscripter.sln

README.MD

Coverage Status Build status

Sql Scripter

Sql Scripter is an opinionated tool to implement a complex CI/CD pipeline on sql server while being source control friendly.

Install latast version

dotnet tool install -g sqlscripter

or update:

dotnet tool update -g sqlscripter

Create a Full script of a database respecting dependency

sqlscripter dbindex -S <server> -U <user> -P <password> -d <dbtarget> -i <index-file> 
sqlscripter script -S <server> -U <user> -P <password> -d <dbtarget> -i <index-file> -o <output-directory>
sqlscripter build -i <index-file> -o <output-file>

The first step will create and index indicating the correct order to build your database. In case there should be any invalid or external dependency it will insert in the file a ## comment.s

The second step will generate script for all objects indicated in the index file. You can use more than one index file. For instance you could have some script to add data after the database is created.

The files generated or re-generated in the first two steps should be put under source control.

Whenever you modify an object you can just re-run the second step.

If you add objects you may re-run the first step or add the new objects manually to the index.

Finally run the third step and you will get the full script to create or update your database. This step can usually be performed on your build server or process.

You can’t perform that action at this time.