https://github.com/sethreno/schemazen
Script and create SQL Server objects quickly
https://github.com/sethreno/schemazen
c-sharp database mssql schema version-control
Last synced: 10 months ago
JSON representation
Script and create SQL Server objects quickly
- Host: GitHub
- URL: https://github.com/sethreno/schemazen
- Owner: sethreno
- License: mit
- Created: 2013-02-20T15:05:09.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2024-01-17T10:23:59.000Z (about 2 years ago)
- Last Synced: 2025-03-28T20:10:03.924Z (11 months ago)
- Topics: c-sharp, database, mssql, schema, version-control
- Language: C#
- Homepage:
- Size: 1.25 MB
- Stars: 339
- Watchers: 42
- Forks: 141
- Open Issues: 60
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: license.txt
Awesome Lists containing this project
- sqlserver-kit - Schemazen - script and create SQL Server objects quickly
README
# Schema Zen - Script and create SQL Server objects quickly
## Schema Zen has three main commands:
### script
dotnet schemazen script --server localhost --database db --scriptDir c:\somedir
This will generate sql scripts for all objects in the database in a
directory structure that looks something like:
```
c:\somedir\
data
foreign_keys
procedures
tables
views
props.sql
schemas.sql
```
### create
dotnet schemazen create --server localhost --database db --scriptDir c:\somedir
This will create a database named db from the sql scripts in c:\somedir.
### compare
dotnet schemazen compare --source "server=dev;database=db" --target "server=qa;database=db" --outFile diff.sql
This will compare the databases named `db` between `dev` and `qa` and
create a sql script called `diff.sql` that can be run on `qa` to make it's
schema identical to `dev`.
See ```dotnet schemazen help [command]``` for more information and options on each command.
## Quick Start
If you don't already have a tool manifest in your project
dotnet new tool-manifest
Install SchemaZen
dotnet tool install SchemaZen
Script your database to disk
dotnet schemazen script --server localhost --database db --scriptDir c:\somedir
## 1.x versions
SchemaZen was changed to a cross platform dotnet tool in version 2.0. Older 1.x
releases can be downloaded [here](https://github.com/sethreno/schemazen/releases)
## Contributing
Pull requests are welcome and appreciated. See [contributing.md](contributing.md) for guidelines.
## Chat
[](https://gitter.im/sethreno/schemazen?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
----
Here's some stats and an estimate of what it would cost to develop this project.
[](https://github.com/boyter/scc/)
[](https://github.com/boyter/scc/)
If you've found Schema Zen helpful you can [buy me a
coffee](https://www.buymeacoffee.com/sethreno) to say thanks. Cheers!