How to: Run a Data Generation Plan to Generate Data
To generate data in Visual Studio Premium, you must create and run a data generation plan. The data generation plan contains the information about which tables and columns you want to fill with data. For more information, see Generating Test Data for Databases by Using Data Generators.
Important
You cannot reverse data generation in Visual Studio Premium. You should not generate data on a production database or any other database that contains valuable data. You can however reverse data generation if you use SQL Server transaction functionality.
To run a data generation plan
In Solution Explorer, click a data generation plan, and open it.
On the Data menu, point to Data Generator, and then click Generate Data. You can also click Generate Data on the Data Generator toolbar.
The Generate Data for Target Database window appears.
In the Target Database list, click the database on which you want to generate the data, and then click OK.
Important
If you have not yet connected to that database, you must first click New Connection to create a connection to it. For more information, see How to: Create a Database Connection.
Click Yes or No when you are prompted to clear the contents of the tables before inserting rows. The following are important considerations:
If you click Yes
Visual Studio attempts to delete the existing data in the table before generating the new data.
Tables can have triggers that forbid delete actions. If you try to delete rows from such a table, the trigger rolls back the delete action. Data generation fails for such a table or for a table that references such a table.
You must have appropriate permissions to reseed IDENTITY columns. If you do not have permission to reseed IDENTITY columns, the data that you generate is not deterministic.
If you click No
The data that you generate is added to any existing data in the table.
If you are generating data for columns that have unique constraints, it will likely fail.
The data is generated. The Output window displays each step of the data generation. The Error List window displays any errors that occur. In the data generation plan designer, the status column is updated with the status of the data generation. The status bar displays a summary of the data generation for all the tables.
See Also
Tasks
How to: Create Data Generation Plans
Walkthrough: Creating and Running a Data Generation Plan