Giter Site home page Giter Site logo

schemazen's Introduction

Schema Zen - Script and create SQL Server objects quickly

Join the chat at https://gitter.im/sethreno/schemazen

Schema Zen has three main commands:

script

SchemaZen.exe script --server localhost --database db --scriptDir c:\somedir

This will generate sql scripts for all objects in the database in the following directory structure:

c:\somedir\

	assemblies
	data
	foreign_keys
	functions
	procedures
	synonyms
	tables
	triggers
	users
	views
	xmlschemacollections
	props.sql
	schemas.sql

See SchemaZen.exe help script for more information, including how to specify which tables to export data from (none by default).

create

SchemaZen.exe create --server localhost --database db --scriptDir c:\somedir

This will create a database named db from the sql scripts in c:\somedir.

Note that you can put additional scripts in a folder called after_data, and it will run these between importing the data and adding the foreign key constraints, allowing you to "fix" any necessary records first. (You will need to create this directory first, and the script command will not affect it. The scripts will be run in alphabetical order, so you may want to prefix them with numbers if you want to enforce a certain order. i.e. 00001 - first script.sql, 00002 - second script.sql)

compare (experimental)

SchemaZen.exe compare --source "Data Source=localhost;Initial Catalog=Database1;Integrated Security=True" --target "Data Source=localhost;Initial Catalog=Database2;Integrated Security=True" --outFile c:\somedir\diff.sql

This will compare the databases named Database1 and Database2 on localhost and create a sql script called c:\somedir\diff.sql that can be run on Database2 to make it's schema identical to Database1. Warning this feature is experimental. Be sure to test the script it generates before running in a production environment.


download

The latest release can be downloaded here

schemazen's People

Contributors

danbrad avatar eliah-hecht-zocdoc avatar gitter-badger avatar keith-hall avatar sethreno avatar yzzyx avatar

Watchers

 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.