Dela via


SqlFunctionAttribute Class

Definition

Used to mark a method definition of a user-defined aggregate as a function in SQL Server. The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server.

public ref 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)]
public class SqlFunctionAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
[<System.Serializable>]
type SqlFunctionAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
type SqlFunctionAttribute = class
    inherit Attribute
Public Class SqlFunctionAttribute
Inherits Attribute
Inheritance
SqlFunctionAttribute
Derived
Attributes

Examples

The following example shows an aggregate function that returns a list of files in the specified directory path.

Constructors

SqlFunctionAttribute()

An optional attribute on a user-defined aggregate, used to indicate that the method should be registered in SQL Server as a function. Also used to set the DataAccess, FillRowMethodName, IsDeterministic, IsPrecise, Name, SystemDataAccess, and TableDefinition properties of the function attribute.

Properties

DataAccess

Indicates whether the function involves access to user data stored in the local instance of SQL Server.

FillRowMethodName

The name of a method in the same class which is used to fill a row of data in the table returned by the table-valued function.

IsDeterministic

Indicates whether the user-defined function is deterministic.

IsPrecise

Indicates whether the function involves imprecise computations, such as floating point operations.

Name

The name under which the function should be registered in SQL Server.

SystemDataAccess

Indicates whether the function requires access to data stored in the system catalogs or virtual system tables of SQL Server.

TableDefinition

A string that represents the table definition of the results, if the method is used as a table-valued function (TVF).

Applies to