57.3. Data Generation

As well as versioning the schema, you might want a way to generate data for testing purposes. To do this, you need to add a Data Generation Plan. If you right-click the Offline Schema project under the Add menu, you will find the option for Data Generation Plan. By default all the tables on the schema will be selected, but you can override these settings. In the top section of Figure 57-4 only the Products table is checked. The Categories and Suppliers tables are automatically added (darkened checkboxes) because of the Foreign Key between Products and Suppliers and Products and Categories.

Keep in mind these generation plans are only for development and testing purposes. Don't run them on production servers.

Figure 57.4. Figure 57-4

From the Data Data Generator menu you can open the Column Details and Preview Data Generation windows.

In the plan, you can select the ratio between Related Columns; for example, in Figure 57-4 we are specifying to have 10 products for each supplier (10:1).

In the Column Details window, all columns are selected except for the SupplierID, which is an identity column. You can deselect columns as long as they have either a Default value or allow nulls. In the properties window you can specify the percentage of nulls to be generated. ...

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.