Share via


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

// using Microsoft.Data.SqlClient.Server;

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

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