Insert Scripts for Existing Data

  • Is there any tool that generates Insert Scripts for the data that is already existing in the tables of a database. This I need for creating different test databases on different server with the same set of data, without using the restore option of the total database.

    Any help would be highly appreciated.

     

    Prasad Bhogadi
    www.inforaise.com

  • Prasad

    Have you tried using DTS?  Then you wouldn't need to create any scripts at all.  You can transfer all the data in a table to a text file first if you prefer, or copy it straight to the destination database.

    John

  • Thanks John for the quick reply, however my requirement is a little different, this I need for boot strapping databases at various locations and I will not have the source db available, so it basically needs to be driven through scripts.

     

    Prasad Bhogadi
    www.inforaise.com

  • Hello together,

    I've got the same problem! Need to export the whole DB into

    create table and insert statements.

    Ottmar

  • If I have understood your requirements correctly, you should still be able to script out the database creation (tables, SPs, constraints, views and so on) into one text file and then DTS or BCP each table into its own text file for importing when you have created the new database from the script.  Be careful about the order of import if you have foreign key constraints - parent tables before child tables.  I believe that there are utilities that will automate all this for you, but I've never used any of them.

    John

  • Hi John,

    DTS and SSIS are really great parts of the SQL Server, but for quick use, just exporting data into an sql-script, including foreign keys and existing data in at a logical sort order.

    The great thing is to use a block of sql-files and manage them by using a self made program. Just a CVS for databases!

    Ottmar

  • Check out http://www.codeproject.com/database/InsertGeneratorPack.asp

    I used it last week and it worked a treat.

  • You can try using this script at http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1447






    Regards,
    Sudheer 

    My Blog

Viewing 8 posts - 1 through 7 (of 7 total)

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