ajma
ajma

Reputation: 12206

Command line tool for creating script for specific MSSQL tables

I've been looking at the SqlPubWiz.exe command to write a batch file so that I can keep my script up to date in my source control. But what I need is for the command line tool to allow me to pick specific tables to include (and that I can exclude others). I think SqlPubWiz.exe won't do that for me (let me know if I'm wrong) but if someone can point me to another tool that can do it, that's what I'm looking for.

Upvotes: 0

Views: 1285

Answers (2)

blorkfish
blorkfish

Reputation: 22824

Try DBSourceTools. http://dbsourcetools.codeplex.com
Its open source, and specifically designed to script databases - tables, views, procs to disk.
It also allows you to select which tables, views, db-objects to script.

Upvotes: 0

marc_s
marc_s

Reputation: 754468

There are several commercial tools out there that can create database scripts, e.g.

Here's an article showing off a free tool - however, it will only script ALL objects from your database: Eric Moreau's blog.

If you want to "roll your own", have a look at the Server Management Objects (SMO) - those allow you to inspect your database and create scripts from them.

See info here, here or here.

Marc

Upvotes: 3

Related Questions