SqlFunctionAttribute.TableDefinition 属性
定义
如果方法用作表值函数 (TVF),则为一个字符串,该字符串表示结果的表定义。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
属性值
一个 String 值,它表示结果的表定义。A String value representing the table definition of the results.
示例
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
注解
此属性仅由 Microsoft Visual Studio 用来自动将指定的方法注册为 TVF。This attribute is used only by Microsoft Visual Studio to automatically register the specified method as a TVF. SQL Server 未使用此方法。It is not used by SQL Server.
下面的示例指定使用名称引用用户定义函数 sp_tableFunc 。The following example specifies that the user-defined function is referenced using the name sp_tableFunc. TableDefinition 属性具有值 letter nchar(1)。The TableDefinition property has the value letter nchar(1).