database creation script generation

  • I have a database that was created manually. What I would like to do is generate a SQL script that will recreate this database together with all its rows (some of the tables have identity insert turned on).

    Is there any automatic way or tool to do just that?

    Thanks,

  • Backup database and restore to new server or new name is your fastest/safest option.

    Or you could use dts copy object task to do this... but it's really not full proof if you have loads of objects that interact with one another.

  • What I am actually interested in is the SQL script itself that would recreate the database. This is for an installation package purpose. Is there a way at all to generate that script?

  • there is a web sql-management intereface (I beleive at MS) downloadable, I cannot rember where, but it had this functionality.

    If I find it again, I'll add to this reply.

    Here is it's name : Microsoft SQL Web Data Administrator

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • DB Ghost has this functionality.

    1. Script out the database to a temporary directory using DB Ghost data and schema scripter.

    2. Using option 1 of DB Ghost, build a database using the scripts created in step one.

    3. Walk through the wizard answering the appropriate questions.

    4. Make sure you choose the option to record the build to a file and this will create a single SQL file for your database.

    This method ensures the script produced is in the correct order as the Database Builder builds the scripts in the correct order taking into account all dependencies, it may even find errors within your database that you can rectify.

     

     

    regards,

    Mark Baekdal

    http://www.dbghost.com

    http://www.innovartis.co.uk

    +44 (0)208 241 1762

    Build, Comparison and Synchronization from Source Control = Database change management for SQL Server

     

     

     

  • Great!

    Thanks a lot guys.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply