How to: Preview a Data Generation Plan

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. For more information, see Generating Test Data for Databases by Using Data Generators.

After you have created a data generation plan, you can preview the data before you generate it. You can preview one table at a time.

Note

When you preview a data generation plan, you can see a sample of the random data that is generated when you run the plan. Previewing the data does not guarantee that the plan will run successfully. If the data that is generated does not satisfy a check constraint on a column, the plan fails when you run it.

To preview a data generation plan

  1. Open or create a data generation plan.

    The data generation plan opens in the Visual Studio designer. The Data Generation Preview window also appears, unless you have closed it previously.

    Note

    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, open the Window menu, and then click Tabbed Document. You can also right-click the title bar and then click Tabbed Document.

  2. Click the data generation plan window, and click a table that you want to preview.

  3. Click the Data Generation Preview window.

    The table appears with the sample data displayed. Only the columns that are selected for data generation appear. Some columns such as identity, foreign key, timestamp, and binary columns do not display data, because they are computed while the data is generated. If you are satisfied with the data that appears, go to the final step.

    Note

    By default, the first 50 generated rows appear for a table. You can change the default by using the Options dialog box. For more information, see Options (Database Tools/Data Generator/General).

  4. (Optional) Click in the column details pane of the data generation plan window, and change the details and properties of the data that is generated. As you make changes, the Data Generation Preview window is refreshed so that you can review the new sample data based on the changes that you made.

    You can control what data is generated to fill columns by setting the properties of the columns in the data generation plan. For more information, see Specify Details of Data Generation for a Column.

  5. (Optional) Repeat steps 2 through 4 for each table and column that the data generation plan includes.

  6. On the File menu, click Save.

    Now that you have previewed the data, you can run the plan to generate the data. For more information, see How to: Run a Data Generation Plan to Generate Data.

See Also

Tasks

How to: Specify Columns for Data Generation

How to: Specify the Number of Rows to Generate

Walkthrough: Creating and Running a Data Generation Plan