If found the attribute OUT() in the argument list of a function (SQL Server
2005)
Is the attribute Out() mandatory? or Optional?
(See the arguments of the sub FillRow - for the argument STR passed by
reference)
Below is the code,
-----------------------------
http://msdn.microsoft.com/sql/learn/...dataaccess.asp
-----------------------------
Imports System.Collections
Imports System.Data
Imports System.Data.SqlClient
Imports System.Transactions
Imports System.Runtime.InteropServices
Imports Microsoft.SqlServer.Server
Partial Public Class Functions
<Microsoft.SqlServer.Server.SqlFunction(FillRowMet hodName:="FillRow")> _
' if you're using VS then add the following property setter to
' the attribute above: TableDefinition:="s NVARCHAR(4000)"
Public Shared Function ParseString(ByVal str As String) As IEnumerable
' Split() returns an array, which in turn
' implements IEnumerable, so we're done :)
Return Split(str, ",")
End Function
Public Shared Sub FillRow(ByVal row As Object, <Out()> ByRef str As
String)
' "crack" the row into its parts. this case is trivial
' because the row is only made of a single string
str = CType(row, String)
End Sub
End Class
-----------------------------