|
Prev: select cases where a datetime is not 3 or more hours older thana similar case
Next: Granting permissions for a user from another database
From: D.Stone on 16 Apr 2008 11:00 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
From: Pasi Oja-Nisula on 16 Apr 2008 16:05
On 2008-04-16, D.Stone(a)ed.ac.uk <D.Stone(a)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 |