View or Save Generated SQL?

jalbenbergjalbenberg Posts: 7
edited September 22, 2009 8:26AM in SQL Data Generator Previous Versions
Is there any way to view or save the SQL that is generated from the execution of this program? If I am inserting 1 row into each of 250 tables, I would like to save the SQL Script with 250 insert statements.

Comments

  • Hello,

    Thanks for your post. Currently, there is no way to view the SQL statements for the generation. However, i'll add the suggestion to the list for reviewing.

    Regards

    Ben
  • DanAvniDanAvni Posts: 72 Bronze 2
    please add this to the wishlist and work on it soon. we thought it was possible until today we inserted data to 20 tables (it took us a few hours just tweaking all the fields to the correct values) and then the data was inserted locally instead of on a remote machine where we actually need it.
    Dan Avni
  • Hi,

    It also the feature that is missing for me. Most of times I need a script that inserts generated data.

    To get /save a script (as a workaround) I usually put two the same databases onto one (local) server, generate data against the first and then using the SQL Data Compare, I'm comparing these two databases. At the end of synchronisation (of SQL Data Compare) wizard there is an option to see the script and copy or save it.

    This is the easiest way that I have found.
    Kamil Pakur
  • You can easily do what you all are asking with several tools that are available. Once you generate the data into your test database, then use something like this:

    http://www.codeproject.com/KB/database/ ... abase.aspx


    To dump that data to SQL scripts. I agree that it should be a feature in Data Generator to skip the extra step, but it is possible to do so right now.
  • ptrubsptrubs Posts: 15 Bronze 3
    I agree, this is a much needed feature and would complete the package.

    I'd rather run scripts for my deployments (or when generating test data for integration tests) rather than running the app as part of the build process.

    strange that redgate should chose to omit this facility?
  • Under the hood SQL Data Generator doesn't generate DML INSERTs, instead it uses bulk inserting for performance reasons.

    I guess we could log a feature request to generate a DML script as an alternative to applying the bulk insert directly to your database.

    Kind regards,

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.