You can use SQL and XQuery editor to create user-defined
functions from the Data Source Explorer.
About this task
Using the SQL and XQuery Editor, you can create a user-defined
function based on a template, then modify the code in the editor as
needed. This method is useful if you want to quickly create a user-defined
function and run it on the server.
Procedure
To create a user-defined function from the Data Source
Explorer:
In the Data Source Explorer, right-click the User-Defined
Functions folder under a database connection, and click
one of the following menu items:- Click to open a user-defined
function template in the SQL and XQuery editor.
- Click to open a window so that
you can specify a name, language, and data development project for
the user-defined function, then click Finish.
If you use the SQL and XQuery editor, you can modify the
template and run the user-defined function from the SQL and XQuery
editor view to deploy the user-defined function to the database. If
you use the Routine Editor, the user-defined function is added to
the
User-Defined Functions folder in the data
development project that you specified, and the user-defined function
opens in the routine editor.