Including User-Defined Functions in a Query

Visual Database Tools

Visual Database Tools

Including User-Defined Functions in a Query

You can include a user-defined function in a query.  You can include any of the three types of functions:

  • Non-updateable functions returning a table

  • Updateable functions returning a table

  • Functions returning a scalar

To include an updateable or non-updateable table function in a query or view

  1. Design the query to which you want to add the function.  In the Query Designer, be sure the Diagram pane is visible.

  2. In the SQL Server Enterprise Manager, expand the Databases node and the particular node for the database you are working on.

  3. Click the User Defined Functions node.

  4. From the list of functions, drag the function onto the Diagram pane.

To include a scalar function in a query or view

  1. Design the query to which you want to add the function.  In the Query Designer, be sure the Grid pane is visible.

  2. In the SQL Server Enterprise Manager, expand the Databases node and the particular node for the database you are working on.

  3. Click the User Defined Functions node.

  4. In the first blank row of the Grid pane, enter the name of the function in the Column column.

See Also

User-Defined Functions