Red Gate forums :: View topic - Relative file path in XML for FileListGenerator?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 3
SQL Data Generator 3 forum

Relative file path in XML for FileListGenerator?

Search in SQL Data Generator 3 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Try2BWise



Joined: 14 Mar 2014
Posts: 3
Location: United States

PostPosted: Fri Mar 14, 2014 8:50 pm    Post subject: Relative file path in XML for FileListGenerator? Reply with quote

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!
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6644

PostPosted: Mon Mar 17, 2014 1:39 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Try2BWise



Joined: 14 Mar 2014
Posts: 3
Location: United States

PostPosted: Mon Mar 17, 2014 3:13 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6644

PostPosted: Mon Mar 17, 2014 5:07 pm    Post subject: Reply with quote

You can submit a feature request for this if you need to configure the folder where SDG will look. http://redgatesupport.red-gate.com/forums/22343586-SQL-Data-Generator
Back to top
View user's profile Send private message
Try2BWise



Joined: 14 Mar 2014
Posts: 3
Location: United States

PostPosted: Fri Mar 21, 2014 4:23 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group