I want to create a schema in SQL Server database. There are also bunch of other scripts in the database. Can I script out an existing schema? I mean, suppose we have a table, we can
script out a CREATE TABLE
script? Can we script out a Create Schema.
Thanking You Guys in Anticipation,
I wrote an open source command line utility named SchemaZen that does this. It's much faster than scripting from management studio and it's output is more version control friendly. It supports scripting both schema and data.
To generate scripts run:
schemazen.exe script --server localhost --database db --scriptDir c:\somedir
Then to recreate the database from scripts run:
schemazen.exe create --server localhost --database db --scriptDir c:\somedir
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With