Scripting just the contents of a table
Imar
Posts: 8 Bronze 2
Hi there,
I really like the data compare options of this tool. However, quite often I need just a simple INSERT script of the data in a specific table and don't need the overhead of comparing two tables or databases with each other.
Here's what I have in mind:
1. I right-click a table and choose Script Data
2. I can either select to script the entire table, or specify a query
3. I can save the results to a script file or a new query window
4. I define how I want identities handled (ignored, scripted etc)
5. I click Script
I then get a file or query window with INSERT statements to regenerate the data in some other database table with a matching schema.
The compare tool seems to support most of this, but it's not easily accessible like this. To do what I am describing above, I have to create a fake table with a matching schema in some random database, and do a compare with the empty table to create my data.
Can a "script only" feature be added to the product someday? Or is something like this already available in another product?
Thanks!
Imar
I really like the data compare options of this tool. However, quite often I need just a simple INSERT script of the data in a specific table and don't need the overhead of comparing two tables or databases with each other.
Here's what I have in mind:
1. I right-click a table and choose Script Data
2. I can either select to script the entire table, or specify a query
3. I can save the results to a script file or a new query window
4. I define how I want identities handled (ignored, scripted etc)
5. I click Script
I then get a file or query window with INSERT statements to regenerate the data in some other database table with a matching schema.
The compare tool seems to support most of this, but it's not easily accessible like this. To do what I am describing above, I have to create a fake table with a matching schema in some random database, and do a compare with the empty table to create my data.
Can a "script only" feature be added to the product someday? Or is something like this already available in another product?
Thanks!
Imar
Comments
You can select the objects you want, so in your case you could select just the one table.
I think the only issue is that you can only package data for tables where you've already selected to package the schema - but you could edit the script afterwards to remove the table-create portion.
Hope that helps.
Redgate Software
May I suggest some improvements here or should I post them in the Packager forum?
Imar
Redgate Software
Thanks for your quick replies. I'll send an e-mail to Support.
Cheers,
Imar