SQL Server - tool to create insert sql for table data
Asked By John A Grandy
03-Oct-08 05:39 PM
I need a tool to create insert sql for all data in a table ...
So, this tool would generate one insert statement for each row in the table.
Does such a beast exist ?
SQL Server 2008
(1)
Stored procedure
(1)
Database
(1)
Scripter
(1)
Packager
(1)
Grandy
(1)
Datacomparesql
(1)
Renumber
(1)
mouser replied...
I have used a few, but they usually turn into paid products. I liked the
one at http://www.sqlscripter.com but it became rather expensive for the
level of polish. Also, there is one at http://www.codeplex.com/sqlgen which
is free but does have a few bugs....
Tom Cooper replied...
Another free one is at http://vyaskn.tripod.com/code.htm#inserts
Tom
Plamen Ratchev replied...
Here is a method using stored procedure:
http://vyaskn.tripod.com/code.htm#inserts
--
Plamen Ratchev
http://www.SQLStudio.com
John A Grandy replied...
I'm using SQL Scripter ...
On problem I am coming across is how to renumber identity column values.
Easy for a solitary table ... just remove the identity col from the select
list and gen the script ...
But what if there's a 2nd table with an FK join to the first table ...
mouser replied...
I am not sure the tool was intended to do that. It attempts to generate the
scripts for the tables you have chosen verbatim.
John A Grandy replied...
Sure , I don't expect the tool to do this for me ...
But this is a tricky problem , because with huge datasets , if you extract
sub-portions of data ( for example a single user's data ) and seed it into a
new db , your identity columns have all sorts of gaps ...
mouser replied...
I am not sure what to say. Can you tell us why you need to renumber the
identity column?
mouser
Eric Isaacs replied...
Stepping back a little, why do you need individual inserts for each
row? Are you attempting to duplicate the table and all it's data? Is
it within the same database, or a connected database? Do you need to
script the creating of the tables, relationships, and the data for an
install?
Look into the tools from Red-Gate Software. http://www.red-gate.com/
Their SQL Packager might be just what your looking for. All the tools
have a free trial period.
-Eric Isaacs
Jacob Sebastian replied...
And, If you have the management studio (SSMS) of SQL Server 2008, go to
move the data.
--
Jacob Sebastian
SQL Server MVP
http://www.sqlserverandxml.com
Thoma replied...
Try http://www.sqlscripter.com to generate data scripts. Insert, Update,
Delete + mix are supported.
Optillect Team replied to John A Grandy
Let us suggest Optillect Data Compare SQL. It has special option "Full data transfer mode", which allows to generate all INSERTs for all or particular tables or/and views in your database. Moreover, you can exclude columns and rows you need!
Check it out at
http://optillect.com/products/datacomparesql/overview.html
SSIS package in sql server 2008 SQL Server I am using sql server 2000 and want to move to sql server 2008 How to create / edit a ssis(dts) package in sql server 2008? Previously
SQL Server 2008 R2 SQL Server Is this a full or cutdown version of SQL Server 2008 Enterprise? SQL Server Discussions SQL Server 2008 R2 (1) SQL Server 2005 (1) Windows Server
linked servers between different sql versions?? SQL Server Can a SQL Server 2008 server have a linked server that is SQL Server 2008 R2?? We presently use a SQL Server 2008 for reporting
SQL 2005 Studio connect to SQL 2008 SQL Server How can I make my SQL Server 2005 Management Studio to connect to a remote SQL Server 2008? SQL Server Tools Discussions SQL Server 2000 (1) SQL Server 2008 (1) SQL
Clustering on SQL Server 2008 SQL Server Is failover clustering the only type of clustering available on SQL Server 2008? More specifically, does SQL Server 2008 support Active / Active clustering that is NOT failover clustering