Export (0) Print
Expand All

The Data Bound Generator

By using the data bound generator, you can fill columns with data that is taken from a pre-existing data source. Some examples of possible data sources are a database, a Microsoft Excel workbook, or a text file.

To use the data bound generator to fill a column with data, you must configure the column correctly. You must specify the DataBound generator as the generator for the column, and you must set the generator properties for the column. For more information, see Specify Details of Data Generation for a Column.

The Data Bound Generator Properties

The following properties are specific to the data bound generator:

  • The Connection Information property, which specifies the connection string for the data source from which you are reading data. You can specify the connection string in the following three ways:

    • Type the connection string into the property.

    • Click the down arrow, and then click an existing connection.

    • Click the down arrow, and then click Add new connection.

  • The Select Query property, which specifies the select query that retrieves data from the data source. For example, you can type the following:

    SELECT * FROM dbo.Customers
    

The Generator Output

By setting the Connection Information and the Select Query properties, you specify a data set that is returned from the data source. After you set these properties, you must set the Generator Output column in the Column Details window. The Generator Output column contains a list of the columns in the data set that are of the appropriate data type for the column that you want to fill with data. You can click the down arrow to specify the data that you want to use.

If the query returns no columns that are of the appropriate data type for the column, the text <No Coercible Output> appears. If the query returns any columns that are not named, you must change the query to name all columns. The following error appears: Input verification failed with the following error: Could not retrieve schema information. If the select statement produces a result set with unnamed columns, use the 'AS' keyword to name the column. For example, instead of the following:

SELECT * FROM dbo.Customers

Use the following:

SELECT CustomerID, CompanyName, ContactName FROM dbo.Customers

Considerations for Large Data Sources

If you are using the data bound generator to read data from a large data source, you might experience performance problems. The following approaches can help you avoid performance problems:

  • Select only the column that you want. For example, instead of the following:

    SELECT * FROM dbo.Customers
    

    Use the following:

    SELECT ContactName FROM dbo.Customers
    
  • Select only the amount of data that you need. For example, if you are generating only 50 rows of data but the data source contains 2,000 rows of data, you only need to select the first 50 rows of data. For example, instead of the following:

    SELECT * FROM dbo.Customers
    

    Use the following:

    SELECT TOP 50 * FROM dbo.Customers
    

    You can combine this approach with the previous one, as in the following example:

    SELECT TOP 50 ContactName FROM dbo.Customers
    

Community Additions

ADD
Show:
© 2015 Microsoft