Set a column in all tables to same value
JeremyR
Posts: 2
I have a common column in all tables of my database. I would like SQL Generator to use the same value in all tables per round. For example, I have 149 tables and I want to generate data in batches and be able to filter based on the batch that was generated. I did see that I could change the value in the project file but that is tedious, at least for the first round. After the first round I can use a find and replace but getting help with the first round would be nice.
Tagged:
Comments
You should still be able to use a Find and Replace for the first round by changing the value for one of the columns first and then opening the .sqlgen project in a text editor to find/replace the .
For example, using a SQL Expression to set the value of a CategoryID column to 'Round1' has the following xml in the .sqlgen file:
You could find and replace the <Generator> node as needed for the matching columns in the other tables.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
Ah I see, thanks for clarifying that!
There currently isn't a built-in feature to make the same change to multiple columns at once, unfortunately. We do have a feature request for this with reference SDG-1002 though and I have +1'd this with your feedback.
Thank you and so sorry again that there isn't an easier way to do this at the moment!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
You should still be able to use a Find and Replace for the first round by changing the value for one of the columns first and then opening the .sqlgen project in a text editor to find/replace the Generator details.
For example, using a SQL Expression to set the value of a CategoryID column to 'Round1' has the following xml in the .sqlgen file:
You could find and replace the <Generator> node as needed for the matching columns in the other tables.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
You should still be able to use a Find and Replace for the first round by changing the value for one of the columns first and then opening the .sqlgen project in a text editor to find/replace the .
For example, using a SQL Expression to set the value of a CategoryID column to 'Round1' has the following xml in the .sqlgen file:
You could find and replace the <Generator> node as needed for the matching columns in the other tables.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
You should still be able to use a Find and Replace for the first round by changing the value for one of the columns first and then opening the .sqlgen project in a text editor to find/replace the Generator details.
For example, using a SQL Expression to set the value of a CategoryID column to 'Round1' has the following xml in the .sqlgen file:
You could find and replace the <Generator> node as needed for the matching columns in the other tables.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?