ExecUDF 的 Visual Basic 代码列表
后续版本的 Microsoft SQL Server 将删除该功能。 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。
以下代码将创建 ExecUDF。
Dim proxy As New server.sql_endpoint
Dim response As New Object
Dim resultXml As System.Xml.XmlElement
Dim errorMessage As server.SqlMessage
Dim outputParam As System.Int32
Dim param
Dim i As System.Int16
Dim rowCount As server.SqlRowCount
Dim outParam As server.SqlParameter
ListBox1.Items.Add("1) Executing UDFReturning scalar. Result returned as int ")
ListBox1.Items.Add("")
param = TextBox1.Text
proxy.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim result As System.Int16
result = proxy.UDFReturningAScalar()
ListBox1.Items.Add("UDF Return value ")
ListBox1.Items.Add(result)