How to: Specify Columns for Data Generation

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 Data Generation Plans.

The following are important things to consider when you specify columns for data generation:

  • You must generate data for primary key columns.

  • You must generate data for columns that are not nullable, except columns that have a default constraint.

  • You can partially fill a nullable column. To test NULL values, you do not have to leave a whole column null. Include the column in data generation, and then set the Percentage Null property for the column.

Before you can specify the columns that you want to fill with data, you must open or create a data generation plan, and specify the tables that you want to fill with data. For more information, see How to: Create Data Generation Plans and How to: Specify Tables for Data Generation.

To select columns to fill with data

  1. Open or create a data generation plan. The data generation plan, the Data Generation Preview window, and the Column Details window all appear in the Visual Studio designer.

    Note

    If the Column Details and Data Generation Preview windows are not open, you can open them by opening the Data menu, pointing to Data Generation, and then clicking the window name. By default, the Data Generation Preview window and the Column Details window are 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.

  2. Click on the data generation plan window.

    All the tables in the schema are listed in the data generation plan.

  3. Click a table for which you want to specify columns to fill.

  4. Click the Column Details window.

    All the columns in the table are listed in the Column Details window.

  5. Select and clear the check boxes in front of each column to specify the columns that you want to fill with data. You will not be able to clear the check boxes for columns that are primary keys, or that are not nullable and do not have default constraints.

    Note

    The Properties window displays the Allow Nulls and Default Value properties. You can use these properties to decide which columns to fill with data.

  6. (Optional) Repeat steps 3 through 5 for each table included in the data generation plan.

  7. On the File menu, click Save.

    Now that you have specified what columns you want to include, you can specify how you want to fill the columns with data. For more information, see Specifying Details of Data Generation for a Column.

See Also

Tasks

How to: Run a Data Generation Plan to Generate Data
Walkthrough: Creating and Running a Data Generation Plan

Concepts

Overview of Generating Data

Other Resources

How to: Specify the Number of Rows to Generate
Data Generator Walkthroughs