Creating, Altering, and Removing User-Defined Functions

The UserDefinedFunction object provides functionality that lets users programmatically manage user-defined functions in Microsoft SQL Server. User-defined functions support input and output parameters, and also support direct references to table columns.

SQL Server requires assemblies to be registered within a database before these can be used inside stored procedures, user defined functions, triggers, and user defined data types. SMO supports this feature with the SqlAssembly object.

The UserDefinedFunction object references the .NET assembly with the AssemblyName, ClassName, and MethodName properties.

When the UserDefinedFunction object references a .NET assembly, you must register the assembly by creating a SqlAssembly object and adding it to the SqlAssemblyCollection object, which belongs to the Database object.

請參閱

參考

UserDefinedFunction

其他資源

建立使用者自訂函數 (Database Engine)

說明及資訊

取得 SQL Server 2005 協助