


First, then, you use the data generator to fill the database with randomly generated dummy data and save the project file and then you run it from a PowerShell script (or alternatively, you can write a command line batch script). You can’t use, or won’t accept the risk of using, live production data to run your tests, so you need to create some fake data, or load pre-prepared data.
#SQL DATA GENERATOR HOW TO#
I’ll show you how to do this using PowerShell, a database build script, and a data generation tool for SQL Server, in this case SQL Data Generator. Let’s say that you need to build a new test database, from the latest version in source control, populate the tables with fake but realistic test data, run the tests, and then tear down the database. He is a regular contributor to Simple Talk and SQLServerCentral. Phil Factor (real name withheld to protect the guilty), aka Database Mole, has 30 years of experience with database-intensive applications.ĭespite having once been shouted at by a furious Bill Gates at an exhibition in the early 1980s, he has remained resolutely anonymous throughout his career.
