SqlFunctionAttribute 類別

定義

用於將使用者定義彙總的方法定義標記為 SQL Server 中的函式。 該屬性 (Attribute) 上的屬性 (Property) 反映使用 SQL Server 註冊型別時使用的實體特性。

public ref class SqlFunctionAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public class SqlFunctionAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
[System.Serializable]
public class SqlFunctionAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
type SqlFunctionAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
[<System.Serializable>]
type SqlFunctionAttribute = class
    inherit Attribute
Public Class SqlFunctionAttribute
Inherits Attribute
繼承
SqlFunctionAttribute
衍生
屬性

範例

下列範例顯示會傳回指定目錄路徑中檔案清單的聚合函數。

建構函式

名稱 Description
SqlFunctionAttribute()

使用者定義彙總上的選擇性屬性,用於指示這個方法應該在 SQL Server 中註冊為函式。 還用於設定函式屬性 (Attribute) 的 DataAccessFillRowMethodNameIsDeterministicIsPreciseNameSystemDataAccessTableDefinition 屬性 (Property)。

屬性

名稱 Description
DataAccess

指出函式是否涉及存取 SQL Server 之本機執行個體中儲存的使用者資料。

FillRowMethodName

用來填滿資料表值函式所傳回之資料表中資料列相同類別中方法的名稱。

IsDeterministic

指出使用者定義函式是否具有決定性。

IsPrecise

指出此函數是否包含不精確的計算,如浮點運算。

Name

函式應在 SQL Server 中註冊的名稱。

SystemDataAccess

指出函式是否需要存取 SQL Server 之系統類別目錄或虛擬系統資料表中儲存的資料。

TableDefinition

字串,當方法用做資料表值函式 (TVF) 時,表示結果的資料表定義。

適用於