SqlFunctionAttribute.TableDefinition SqlFunctionAttribute.TableDefinition SqlFunctionAttribute.TableDefinition SqlFunctionAttribute.TableDefinition Property

Definition

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

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

Property Value

A String value representing the table definition of the results.

Examples

public partial class UserDefinedFunctions
{
    [SqlFunction(Name="sp_tableFunc", TableDefinition="letter nchar(1)")]
    public static IEnumerable SampleTableFunction(SqlString s)
    {
        //...
        return new ArrayList(new char[3] {'a', 'b', 'c'});
    }
}
Partial Public Class UserDefinedFunctions

    <SqlFunction(Name:="sp_tableFunc", TableDefinition:="letter nchar(1)")> 
    Public Shared Function SampleTableFunction(ByVal s As SqlString) As IEnumerable

        '...
        Return New Char(2) {"a"c, "b"c, "c"c}
    End Function
End Class

Remarks

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

The following example specifies that the user-defined function is referenced using the name sp_tableFunc. The TableDefinition property has the value letter nchar(1).

Applies to