Options

Relative file path in XML for FileListGenerator?

Try2BWiseTry2BWise Posts: 4
edited March 21, 2014 11:23AM in SQL Data Generator
I have a number of custom file lists I have implemented by creating custom generator configurations. I would like to have the ability to use a relative file path to the text file.

When I select my custom generator I receive the error that the text file specified in the XML cannot be found in the application-wide "External files" path even though the XML and TXT file are both located in the "User defined generators" path.

I suppose I could enter an absolute path in the XML, but I am not sure that would work since SQL Data Generator interpreted my attempt at a relative path as a literal string.

I would like the ability to use a relative path since my SQL Data Generator projects are edited and used by multiple personnel working out of different local source-controlled (Team Foundation Server) directories.

Please let me know if / how I can clarify. Thanks!

Comments

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello,

    SQL Data Generator is actually looking in the "External Files" path set in the application settings when you specify a text file to use as a data source and do not include a path.

    You can copy the file to c:\program files (x86)\red gate\sql data generator 3\Config and then go into the .sqlgen file (the project file) using a text editor and change the FileName property for that column's generator to just the filename and it will load the file when you load the project in SDG.

    Hopefully that will help.
  • Options
    I understand how relocating the file will resolve the issue; however, it seems that having to copy the file into the application-wide external file path defeats the purpose of having the ability to define a custom path for user defined generators. It seems logical that a user defined generator definition and any artifacts upon which it depends should be located in and consumed from the same path.

    I'll need to rethink how I manage my solutions with source control ...

    Thanks for the reply!
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    You can submit a feature request for this if you need to configure the folder where SDG will look. http://redgatesupport.red-gate.com/foru ... -Generator
  • Options
    To work around my problem with current file path limitations and my source control needs, I decided to pivot my TXT files to Regular Expressions.

    So, a TXT file with a list of tools such as ...
    adze
    allen wrench
    anvil

    ...becomes (adze|allen wrench|anvil).

    I used a macro in Notepad++ to reformat the text and kept the original TXT file around for reference. Now all the values are embedded in the XML, stored in source control, and my file path problem is eliminated.
Sign In or Register to comment.