How to: Create Data Generation Plans
This topic applies to:
Visual Studio Ultimate
Visual Studio Premium
Visual Studio 2010 Professional
Visual Studio Express
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
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.
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.
In the Categories pane, click Data Generation Plans.
In the Templates pane, click Data Generation Plan.
In the Name box, type the name that you want to give the data generation plan.
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.
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.