Use the SQL Server Function Editor to define a function for a model or table in a SQL Server 2005 physical model.
To define a SQL Server 2005 function
The SQL Server Function Editor opens.
Note: Click New on the toolbar to create a new function. Use the Enter filter text box to filter a very large list of functions to quickly locate the one that you want to define.
Specifies the name of the function. Change the name of the function in this field.
Specifies the schema of the database to which the function belongs. Select the schema from the drop-down list.
Specifies whether the function type is model-level or table-level. Select the type from the drop-down list.
Specifies to attach the selected function to each new table that you create. Clear the check box if you want to manually attach the function to new tables.
Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.
Specifies whether the function is generated as part of a pre-script. Select an option from the drop-down list.
Specifies the type of function and its associated values. Select one of the following function types from the drop-down list:
Scalar Function
Specifies the scalar function type, which returns a single data value. When you select Scalar Function, you can use the Null Input, Return Data Type, Encryption, and Schema Binding options that populate the grid to further define the function.
Inline Table Function
Specifies the inline table-valued function type, which returns a result set of single SELECT statement. When you select Inline Table Function, you can use the Null Input, Encryption, and Schema Binding options that populate the grid to further define the function.
Multistatement Table Function
Specifies the multi-statement table-valued function type, which returns a result set in table form, which was built from multiple statements. When you select Multistatement Table Function, you can use the Null Input, Encryption, Schema Binding, Return Table Definition, and Return Variable options that populate the grid to further define the function.
Scalar Return Assembly Function
Specifies the scalar return assembly function type, which returns a single value by executing a method from an assembly. When you select Scalar Return Assembly Function, you can use the Null Input, Return Data Type, Assembly, Class Name, and Method Name options that populate the grid to further define the function.
Table Return Assembly Function
Specifies the table return assembly function type, which returns a table of values by executing a method from an assembly. When you select Table Return Assembly Function, you can use the Null Input, Return Table Definition, Assembly, Class Name, and Method Name options that populate the grid to further define the function.
Specifies the permission level in effect when the function is executed.
Specifies the user whose permissions are in effect for the execution of the function.
Note: This option is only available if you have selected the Execute As User option in the Type drop-down list.
Specifies the parameters for the function and lets you select the order in which the parameters execute and the properties of each one.
Note: Click New on the toolbar to add a new parameter.
The function is defined and the SQL Server Function Editor closes.
Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |