Results 1 to 5 of 5

Thread: MS sql : generating script

  1. #1
    Join Date
    Jan 2007
    Posts
    3

    MS sql : generating script

    Hi all !

    I am new to ms sql server 2005 so I need some help.
    I have a database named 'quakes' and I want to generate the sql script which constructs the database with it's contents.. I used the 'generate script wizard' but it only generates the script for table creation .. Is there a way to to construct a script for the creation of whole database (like mySql does)?

    Please help, it's an essential part of my project.

    Thank you

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    No, but you can either backup the db or unload data to files with bcp.

  3. #3
    Join Date
    Jan 2007
    Posts
    3
    Thank you very much for your reply!

    I made a backup file for my database but when I am trying to restore it to another computer I have to choose between many backup sets! Which one is the one I need?Also the backup file is almost 2,4GB !It contains thousands of records but some of my classmates used mySQL for constructing the same database (same number of records) and the dump file (sql script) requires only 20MB. Is this reasonable? Why does my backup file require that amount of disk space?

    Thank you !
    Last edited by stathis30_2000; 01-22-2007 at 11:48 AM.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    When you backup the db to file, did you specify 'with init' option? If not, will append every backup to the file. In your case, you can choose last backup for the db to restore.

  5. #5
    Join Date
    Jan 2007
    Posts
    3
    No I didn't specified this option. Maybe this is the reason why the backup file is so big. I deleted my old backup and created a new one. Now its only 50MB!

    Thank you very much ! Your help was valuable !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •