views:

200

answers:

3

I'd like to save data from a SQL Server database table to a file, then load it into another database that has the same table already created in it

How can I do this? I know there should be some simple way of doing it, but stackoverflowsearch and google aren't yielding good answers (or I'm not asking a good question).

+1  A: 

Check bcp utility and BULK INSERT statement.

Lukasz Lysik
Thanks, I'll check this out as well.
Larry Watanabe
+2  A: 

You could use the Import/Export Wizard. Right click on your database in Management Studio and look for import data and export data under the tasks item.

klabranche
Thanks, I'll check this out.
Larry Watanabe
+1  A: 

the bcp utility and BULK INSERT as mentioned by @Lukasz Lysik are good for moving lots of data. However, sp_generate_inserts by Narayana Vyas Kondreddi allows for many filtering options of the data, and good when there isn't that much data.

KM