Possible to run all scripts at once in a data generation project?

Hi,

We have a project where we are generating a lot of columns for a table. We have a lot of python scripts as data generators for many of the columns.

I have noticed that when I change the number of rows to generate that I need to click run script on all of the columns that have a custom Pythons script. I've also noticed this needs to be done sometimes when one of the scripts needs to be changed. I have a few questions around this:
  1. Is there a function somewhere that runs all scripts within the project at one time, rather then having to choose each column?
  2. What does the Run Script button do? I've noticed that it errors out quite often if I've changed a script or modified the row count to generate. It would be helpful to understand what this button does.

    TIA
Tagged:

Answers

  • RichardLRichardL Posts: 417 Gold 4
    edited May 29, 2018 2:11PM
    Hi @Cristy

    Thanks for your post. 

    In SQL Data Generator we are not aware of any such button. Are you sure that you are referring to SQL Data Generator? 

    Kind regards

    Richard Lynch. 
    Customer Support
    Redgate Software
  • CristyCristy Posts: 3 New member
    Hi Richard,

    Yes, I am using SQL Data Generator, Version 4.0.2.1493.

    I'm on the Column Generation Settings screen, where I have a custom Python Script as the generator.

    I am unable to provide you a screenshot of my version, but this screenshot shows where the button exists for me. I am experiencing errors in the project if this Run script button is not pressed when changes are made, or the row count is changed.


  • CristyCristy Posts: 3 New member
    I have determined what the Run Script button does. When pressed, it updates the XML file that makes up the .sqlgen file. Each python script here has it's own Generator element. Each generator has the an element under the GeneratorProperties element that has the key of RowCount, with whatever value has been set in the Table Generation Settings as the number of rows to generate.

    If this value is changed to a higher value, then you need to click Run Script on all of the custom python scripts for the Row Count value to be updated accordingly.

    So, my original question still stands. Is there a way to run this automatically for all Python Generator scripts within the project?
  • Eddie DEddie D Posts: 1,803 Rose Gold 5
    Hi Cristy

    Thank you for your forum post.
    Sadly the Run script will only run the python generator selected, so it will show the data that will be inserted in the preview.  There is not a feature or option to run all python generator scripts within the project, except for the 'Generate Data.. button which runs and populates each table selected for data generation.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Hi Cristy,

    Other than the inconsistency in the number saved in the .sqlgen file, could you describe the problems that not running all the scripts causes you? I believe that when you run the data generation, the incorrect RowCount field for each of the Python generators is updated to the number of rows requested for the table in any case, and so the RowCount entry in the .sqlgen file specific to the generator is actually redundant?

    Best wishes,
    Julia Hayward
    Technical Lead, SQL Toolbelt


    Tech Lead, SQL Toolbelt
    Redgate Software
Sign In or Register to comment.