Previous Topic: SQL Server 2008 Property EditorsNext Topic: Define an Asymmetric Key in SQL Server


Define SQL Server 2008 Aggregates

Use the SQL Server Aggregate Editor in a SQL Server 2008 physical model to define a user-defined function whose implementation is defined in a class of a .NET Framework assembly.

To define an aggregate in SQL Server 2008

  1. Click Target - SQL Server, Aggregates on the Model menu.

    The SQL Server Aggregate Editor opens.

  2. Select the aggregate in the Navigation Grid that you want to define and work with the following options:

    Note: Click New New icon in property editors to create a new object on the toolbar to create a new aggregate. Use the Enter filter text box to filter a very large list of aggregates to quickly locate the one that you want to define.

    Name

    Displays the aggregate name. You can change the aggregate name in this field.

    Schema

    Specifies the schema for the aggregate. Select a schema from the drop-down list or click the New icon to open the SQL Server Schema Editor and create one.

    Return Data Type

    Specifies the data type of the return value. Select a data type from the drop-down list.

    Generate

    Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.

  3. Click the General tab and work with the following options:
    Assembly

    Specifies the assembly that binds with the aggregate function. Select an assembly from the drop-down list or click the New icon to open the SQL Server Assembly Editor and create one.

    Class Name

    Specifies the name of the class.

    Parameters

    Specifies the parameters owned by the aggregate.

    Physical Data Type

    Specifies the physical data type of the aggregate parameter. Select a data type from the drop-down list.

  4. (Optional) Click the Comment tab and enter any comments that you want to associate with the aggregate.
  5. (Optional) Click the Where Used tab to view where the aggregate is used within the model.
  6. (Optional) Click the UDP tab to work with user-defined properties for the aggregate.
  7. (Optional) Click the Notes tab to view history information and view or edit user notes.
  8. Click Close.

    The aggregate is defined and the SQL Server Aggregate Editor closes.