Groups | Blog | Home
all groups > sql server (alternate) > july 2004 >

sql server (alternate) : tool that create sql script to recreate a database


iltrex NO[at]SPAM libero.it
7/14/2004 6:50:10 AM
I need a tool that creates a script to recreate a db, including tables' data.

Does it exists freeware ?

Simon Hayes
7/14/2004 7:24:36 PM

[quoted text, click to view]

Backup and restore is usually the easiest way to copy a whole database,
although there are some things to look out for:

http://support.microsoft.com/default.aspx?scid=kb;en-us;314546&Product=sql2k

Otherwise, you can generate scripts for the objects from Enterprise Manager
(right-click the database and select All Tasks - Generate SQL Script), or
using SQLDMO. There's no direct way to script the data, but you can use
bcp.exe or DTS to export it to flat files, or use something like this:

http://vyaskn.tripod.com/code.htm#inserts

Simon

iltrex NO[at]SPAM libero.it
7/15/2004 1:26:01 AM
[quoted text, click to view]

Of course... but we need the script to make some sort of versioning human readble.

[quoted text, click to view]

That's perfect!!

AddThis Social Bookmark Button