locked
Scripting data in a table to a create script RRS feed

  • Question

  • I have a small 5 column, 40 row table that I would like to create a script to create the table and add the values. I can easily create the create script by Generate Script-->CREATE, but im also wondering how i can automatically generate the INSERT..VALUES piece that adds the pre-existing vales into a script. I guess if i have the insert piece in another script i can merge the create script with it, just need to know how to create the insert script.

    Thanks

    Friday, October 27, 2006 5:50 PM

Answers

  • Please see the link below for a solution:
     
     
    There are 3rd party tools that provide this capability also. Alternatively, you can just BCP out the data and BCP in as part of your database creation process. This is efficient if you are inserting large number of rows.
    Friday, October 27, 2006 7:25 PM

All replies