SfcTSqlExecutor.ExecuteScalar(ServerConnection, String) SfcTSqlExecutor.ExecuteScalar(ServerConnection, String) SfcTSqlExecutor.ExecuteScalar(ServerConnection, String) Method

Definition

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. Do not reference this member directly in your code. It supports the SQL Server infrastructure.

public:
 static System::Object ^ ExecuteScalar(Microsoft::SqlServer::Management::Common::ServerConnection ^ connection, System::String ^ script);
public static object ExecuteScalar (Microsoft.SqlServer.Management.Common.ServerConnection connection, string script);
Public Shared Function ExecuteScalar (connection As ServerConnection, script As String) As Object
Parameters
connection
Microsoft.SqlServer.Management.Common.ServerConnection Microsoft.SqlServer.Management.Common.ServerConnection Microsoft.SqlServer.Management.Common.ServerConnection

The server connection.

script
String String String

A string value of the script.

Returns

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.

Applies to