Метод SfcTSqlExecutor.ExecuteScalar
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server.
Пространство имен: Microsoft.SqlServer.Management.Sdk.Sfc
Сборка: Microsoft.SqlServer.Management.Sdk.Sfc (в Microsoft.SqlServer.Management.Sdk.Sfc.dll)
Синтаксис
'Декларация
Public Shared Function ExecuteScalar ( _
connection As ServerConnection, _
script As String _
) As Object
'Применение
Dim connection As ServerConnection
Dim script As String
Dim returnValue As Object
returnValue = SfcTSqlExecutor.ExecuteScalar(connection, _
script)
public static Object ExecuteScalar(
ServerConnection connection,
string script
)
public:
static Object^ ExecuteScalar(
ServerConnection^ connection,
String^ script
)
static member ExecuteScalar :
connection:ServerConnection *
script:string -> Object
public static function ExecuteScalar(
connection : ServerConnection,
script : String
) : Object
Параметры
- connection
Тип: Microsoft.SqlServer.Management.Common.ServerConnection
The server connection.
- script
Тип: System.String
A string value of the script.
Возвращаемое значение
Тип: System.Object
The first column of the first row in the result set, or a null reference if the result set is empty. Returns a maximum of 2033 characters.