Relative file path in XML for FileListGenerator?

The simplest way to populate your database with test data.

Relative file path in XML for FileListGenerator?

Postby Try2BWise » Fri Mar 14, 2014 8:50 pm

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!
Try2BWise
 
Posts: 3
Joined: Fri Mar 14, 2014 8:41 pm
Location: United States

Postby Brian Donahue » Mon Mar 17, 2014 1:39 pm

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.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby Try2BWise » Mon Mar 17, 2014 3:13 pm

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!
Try2BWise
 
Posts: 3
Joined: Fri Mar 14, 2014 8:41 pm
Location: United States

Postby Brian Donahue » Mon Mar 17, 2014 5:07 pm

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
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby Try2BWise » Fri Mar 21, 2014 4:23 pm

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.
Try2BWise
 
Posts: 3
Joined: Fri Mar 14, 2014 8:41 pm
Location: United States


Return to SQL Data Generator 3

Who is online

Users browsing this forum: No registered users and 0 guests