| Author |
Message |
tilo23
Joined: 22 Dec 2011 Posts: 19 Location: Berkshire, UK
|
Posted: Thu Jan 19, 2012 4:01 pm Post subject: Offset from integer |
|
|
May I create offset from an integer value (just as I can do this for datetime)? Currently I use trigger to update a row after insert, but maybe there is a better way? _________________ Inside the Dilbert's world |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Mon Jan 23, 2012 11:32 am Post subject: |
|
|
Hello,
If you just want to add a set number to another number in an int field, maybe just choosing the right generator, using a custom generator, or a python generator will do the trick. Provided you don't want to add two numbers from two columns in the same table. That's still a problem for SDG. If you can be a bit more specific I can give some advice about how to do it. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
tilo23
Joined: 22 Dec 2011 Posts: 19 Location: Berkshire, UK
|
Posted: Mon Jan 23, 2012 5:41 pm Post subject: |
|
|
Assuming I've got Column1 of integer type, I'd like the Column2 to be in range +1 to +100 in accordance to Column1. i.e.
Column1 Column2
20 76
150 151
6540 6602
etc. _________________ Inside the Dilbert's world |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Tue Jan 24, 2012 4:54 pm Post subject: |
|
|
Hi,
Unfortunately this sort of thing is not possible at the moment, but lots of people have requested that SDG be able to extrapolate values from newly-generated data in the same column. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Wed Jan 25, 2012 12:20 pm Post subject: |
|
|
Ben's done a plugin for SDG that will allow you to do this, but I'm not sure it will work in v2:
http://www.simple-talk.com/dotnet/.net-framework/embedding-ironruby-and-the-dlr-into-sql-data-generator/
SQL Data Generator v2 has Python script embedded in it, but the config object only seems to pass data from the column that is currently being generated and you don't have access to other columns. Not sure why it has this shortcoming... _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
tilo23
Joined: 22 Dec 2011 Posts: 19 Location: Berkshire, UK
|
Posted: Thu Jan 26, 2012 10:07 am Post subject: |
|
|
Exactly. I have spent some time looking at possible python scripts usage and I miss some functionalities...
I will be evaluating the IronRuby generator in the next couple of days - will let you know if that works.
Thanks for the reply anyway. _________________ Inside the Dilbert's world |
|
| Back to top |
|
 |
tilo23
Joined: 22 Dec 2011 Posts: 19 Location: Berkshire, UK
|
Posted: Thu Jan 26, 2012 11:42 am Post subject: |
|
|
I know you don't support the IronRuby stuff - but could you provide me the step-by-step instruction of how to deploy Ben's generator into SDG? Which files need to be copy and where? I have 2.0.1.6 version. _________________ Inside the Dilbert's world |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Thu Jan 26, 2012 3:31 pm Post subject: |
|
|
Usually you just drop a custom generator dll into the SDG program files folder. SDG should reflect the namespace in the DLL and if it's correct, add it to a list of generators you can use. However, it may need to be recompiled for v2 if it doesn't work. Sadly, the SDG team chose not to document any of this, so I don't know exactly how it's meant to work. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
tilo23
Joined: 22 Dec 2011 Posts: 19 Location: Berkshire, UK
|
Posted: Thu Jan 26, 2012 4:00 pm Post subject: |
|
|
When all the dll copied into SDG folder it results in a crash on generators' list open
If you ever decide to adjust the generator for the SDG 2 - please post it somewhere. It looks like a really powerful iprovement towards complicated data validity. Would save my time on writing trigger and update scripts and running several projects... _________________ Inside the Dilbert's world |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Thu Jan 26, 2012 6:15 pm Post subject: |
|
|
I'm emailing you a new build of IronRuby generator. Extract it to your "Generators" folder - seems to work for me on v2. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
tilo23
Joined: 22 Dec 2011 Posts: 19 Location: Berkshire, UK
|
Posted: Mon Feb 06, 2012 11:27 am Post subject: |
|
|
Just to let you know: the Ruby generator is great and solves plenty of my issues Thanks a lot for all the support! You should definitely include this in the next SDG version. _________________ Inside the Dilbert's world |
|
| Back to top |
|
 |
CGLuttrell
Joined: 10 Sep 2009 Posts: 14 Location: Knoxville, TN
|
Posted: Sat Sep 22, 2012 10:40 pm Post subject: Re: |
|
|
| Brian Donahue wrote: |
| I'm emailing you a new build of IronRuby generator. Extract it to your "Generators" folder - seems to work for me on v2. |
Brian, any chance of posting this for others to use? Sounds like it worked great for tilo23.
Thanks, Chris |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
|
| Back to top |
|
 |
|