

You can build some complex and interesting data generation projects with SQL Data Generator. One way to handle those is to use a Python function and return the appropriate values for your system. In a real project, you may have more complicated logic, or more likely, status values. I’ll use an If statement to check if the Balance is >= 0. If you examine any of the other cross column items, you’ll see we need a main() function that returns something. Outside of C# Datatime values, Python is needed.
#Red gate sql data generator generator
The language of choice in SQL Data Generator is Python, specifically Iron Python. Most importantly, I can see the “Insert Column Name”, which lets me pick another column in my table. In this case, let’s look at the Age in Years generator. Let’s look at what I can do for the Status column.Ĭertainly there are RegEx and Python scripts, but there’s a nice “Cross Column” section with some examples. In Data Generator, I have a variety of choices for the generators.

I have positive numbers as Overdrawn and negatives as OK Sometimes the data below matches up, sometimes it doesn’t. If I perform a random generation on these columns, I’ll get some strange data. In another column, I have a status that is either OK or Overdrawn, depending on whether the Balance column is positive or negative. Let’s suppose I have some data that represents a balance in an account. One of the things that people often want to do is generate data, but limit the generation to some data in another column. Give it a try today with an evaluation today. If you’ve never tried it, SQL Data Generator is a part of the SQL Toolbelt. This is a series on SQL Data Generator, covering some interesting scenarios I’ve run into.
