How to: Run a Data Generation Plan to Generate Data

To generate data in Visual Studio Team System Database Edition, 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 Data Generation Plans.

Important noteImportant Note:

You cannot reverse data generation in Database Edition. 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

  1. In Solution Explorer, click a data generation plan, and open it.

  2. 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.

  3. In the Target Database list, click the database on which you want to generate the data, and then click OK.

    Important noteImportant Note:

    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.

  4. 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.


For more information, see Security of Data Generators.

See Also


How to: Create Data Generation Plans

Walkthrough: Creating and Running a Data Generation Plan

Other Resources

Data Generation Plans

Overview of Database Populator

Data Generator Walkthroughs