SqlFunctionAttribute.Name SqlFunctionAttribute.Name SqlFunctionAttribute.Name SqlFunctionAttribute.Name Property

Definition

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

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public string Name { get; set; }
member this.Name : string with get, set
Public Property Name As String

Property Value

A String value representing the name under which the function should be registered.

Examples

public partial class UserDefinedFunctions
{
    [SqlFunction(Name="sp_scalarFunc")]
    public static SqlString SampleScalarFunction(SqlString s)
    {
        //...
        return "";
    }
}
Partial Public Class UserDefinedFunctions

    <SqlFunction(Name:="sp_scalarFunc")> 
    Public Shared Function SampleScalarFunction(ByVal s As SqlString) As SqlString

        '...
        Return ""
    End Function
End Class

Remarks

This attribute is used only by Microsoft Visual Studio to automatically register the specified method as a user-defined function. It is not used by SQL Server.

Thee following example specifies that the user-defined function is referenced using the name sp_scalarFunc.

Applies to