次の方法で共有


UserDefinedFunctions Collection

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The UserDefinedFunctions collection contains UserDefinedFunction objects that reference the Microsoft SQL Server user-defined functions.

現在のオブジェクトを表す SQL-DMO オブジェクト モデル

Properties

Count Property

UserData Property

TypeOf Property

 

Methods

Add Method

Refresh Method

Item Method

Remove Method (Collections)

ItemByID Method

 

解説

With the UserDefinedFunctions collection, you can:

  • Create a user-defined function.
  • Remove a user-defined function.

For more information about creating user-defined functions by using the UserDefinedFunction object and UserDefinedFunctions collection, see UserDefinedFunction Object.

To remove a user-defined function

  1. Use the Item or ItemByID method to reference the targeted user-defined function through the UserDefinedFunction object in the UserDefinedFunctions collection. When extracting a UserDefinedFunction object using the name of the referenced user-defined function, use the owner name to qualify the name, as in:

    Set oUDF = _
    oDatabase.UserDefinedFunctions("SummarizeSales", "dbo") 
    
  2. Use the Remove method of the UserDefinedFunction object to remove the targeted user-defined function.

When using the Item or Remove method, the UserDefinedFunctions collection supports member identification using either name or ordinal reference syntax. For example:

Set oUDF = _
oDatabase.UserDefinedFunctions("SummarizeSales", "dbo").Remove

Or:

Set oUDF = oDatabase.UserDefinedFunctions(1).Remove

Additionally, when using name-based item selection, the Item method allows qualification by owner name of the targeted SQL Server user-defined function, as shown earlier. When using the Remove method, the UserDefinedFunctions collection supports qualification of the targeted object by owner name if the Remove method contains a string with a valid owner name as a parameter. If the Remove method contains an integer as a parameter, no owner name can be specified. In this case, it is suggested that you use the Item method to extract the target, and then use the Remove method of the UserDefinedFunction object to drop a user-defined function.

ms136894.note(ja-jp,SQL.90).gifメモ :
Creating or removing SQL Server user-defined functions by using the UserDefinedFunctions collection requires appropriate permissions.
ms136894.note(ja-jp,SQL.90).gifメモ :
The UserDefinedFunctions collection is not compatible with SQL Server version 7.0 or earlier.

参照

その他の技術情報

Notification Services のセキュリティの設定

ヘルプおよび情報

SQL Server 2005 の参考資料の入手