How to: Create Data Generation Plans

This topic applies to:

Visual Studio Ultimate

Visual Studio Premium

Visual Studio 2010 Professional 

Visual Studio Express

Topic applies Topic applies Topic does not apply Topic does not apply

To generate data, 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. It also contains details about what kind of data that you want to put in each column, and how much. The data generation plan is saved as a file in the database project that you can edit and reuse. For more information, see Generating Test Data for Databases by Using Data Generators.

To create a data generation plan

  1. Open or create a database project.


    If you create a data generation plan in a database project that does not have a schema yet, the plan will be empty. If you import a schema into the database project after you have created the plan, you are prompted to decide whether to update the plan based on the new schema.

  2. You add a new data generation plan to the database project by using the Add New Item dialog box. There are three ways to access the dialog box:

    • Click a folder in Solution Explorer. On the Project menu, click Add New Item.

    • Right-click a folder in Solution Explorer, point to Add, and then click New Item.

    • Right-click the Data Generation Plans node in Solution Explorer, point to Add, and then click Data Generation Plan.

    The Add New Item dialog box appears.


    You can use the first method to create a data generation plan in any folder in Solution Explorer. You do not have to store the data generation plans in the Data Generation Plans folder.

  3. In the Categories pane, click Data Generation Plans.

  4. In the Templates pane, click Data Generation Plan.

  5. In the Name box, type the name that you want to give the data generation plan.

  6. Click Add.

    The file for the data generation plan is created and appears in Solution Explorer. The data generation plan window and the Data Generation Preview window open in Visual Studio. The data generation plan window is split horizontally. The upper area displays a list of all of the tables in the database project. The lower area displays column details for the highlighted table.


    If the Data Generation Preview window is not open, you can open it by opening the Data menu, pointing to Data Generation, and then clicking the window name. By default, the Data Generation Preview window is docked and tabbed at the bottom of the data generation plan window. To expand your view, click the window and then click Tabbed Document on the Window menu. You can also right-click in the title bar and then click Tabbed Document.

  7. On the File menu, click Save.

    Now that you have created a data generation plan, you must specify what tables you want to include. For more information, see How to: Specify Tables for Data Generation.

See Also


Walkthrough: Creating and Running a Data Generation Plan


Specify Details of Data Generation for a Column