Dump table as INSERTs

Dump table as INSERTs

am 16.04.2008 17:00:25 von D.Stone

Is there an easy way to create a SQL script to re-create and re-
populate a table?
Both Enterprise Manager 8.0 and Management Studio Express 2005 will
generate the CREATE TABLE, but they only seem to produce a generic
INSERT statement with place-holders instead of values. Not ideal for
any table with more than 10 rows!

Cheers,

Dave

Re: Dump table as INSERTs

am 16.04.2008 22:05:51 von Pasi Oja-Nisula

On 2008-04-16, D.Stone@ed.ac.uk wrote:
> Is there an easy way to create a SQL script to re-create and re-
> populate a table?
> Both Enterprise Manager 8.0 and Management Studio Express 2005 will
> generate the CREATE TABLE, but they only seem to produce a generic
> INSERT statement with place-holders instead of values. Not ideal for
> any table with more than 10 rows!

Yes, it's handy for those cases where you have some rows but not
really much, since then you need bcp anyway.

I'm using Aqua Data Studio and it has export data functionality
where you can select the table and it creates the inserts. Or you
can also script the table and inserts at the same time.

I'm sure lots of other database management ide/toolbox/whatever products
have similar options available. It actually is useful to invest some
time in trying out these external utilities. After using ADS for some
years, there's no way I'm going back to Enterprise manager or
SQL Management studio.

Pasi