
The moment you specify database connection and click on the OK button, the data generation plan starts generating data for each table selected in the plan and shows the status as follows. This will launch the Connect to Database wizard, as shown below, where you need to specify the database details where you want to generate the test data. To start generating data, click on the Generate Data icon in the toolbar or hit F5. Depending on the relationship defined the data generation plan shows related tables and you can specify a ratio for related tables for data generation as shown below. You can choose which tables you want to generate test data and how many records you want to generate for each table. By default all the tables are included in the plan for data generation.

The Data Generation Plan will scan through the schema objects of your database project and will list all the tables that exist. Specify an appropriate name for your data generation plan as shown below and click on the Add button. In Add New Item dialog box, select Data Generation Plan node in the left side under Database Project node and choose empty Data Generation Plan template from the detail section. Right click on your project node in the Solution Explorer, go to Add and then click on New Item as shown below: Launch Microsoft Visual Studio 2010 IDE (Integrated Development Studio) and open your database project. Note: In this demonstration I am going to show how you can generate test data in Visual Studio 2010 Ultimate edition although you can do the same with Visual Studio 2005/2008 Database edition too. If it does not suffice your need or you have different business rules which can't be satisfied by using the built-in data generators, you can even create your own custom data generators too.


You can change properties of these data generators to define the range and format of the data being generated as well. It uses several built in data generators which generate random data or generate data from other data sources as per your column data type. Data Generation Plan contains how you want your test data to be generated for your specific tables and columns. One of them is generating random test data using Data Generation Plan. Visual Studio Database edition provides several features for database development and testing. So how you can generate test data or replicate similar data as in production for your development or test environment? Solution By: Arshad Ali | Updated: | Comments (7) | Related: More > TestingĪs a database developer or tester sometimes you need to have production like data in your environment for your development or testing, but you cannot have the production data because of security and privacy issues.
