BackupRestoreBase.ExecuteSqlWithResults Method
Executes a batch of Transact-SQL statements that expects one or more returned results sets on the specified instance of SQL Server.
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.SmoExtended (in Microsoft.SqlServer.SmoExtended.dll)
Syntax
'Declaration
Protected Function ExecuteSqlWithResults ( _
server As Server, _
cmd As String _
) As DataSet
'Usage
Dim server As Server
Dim cmd As String
Dim returnValue As DataSet
returnValue = Me.ExecuteSqlWithResults(server, _
cmd)
protected DataSet ExecuteSqlWithResults(
Server server,
string cmd
)
protected:
DataSet^ ExecuteSqlWithResults(
Server^ server,
String^ cmd
)
member ExecuteSqlWithResults :
server:Server *
cmd:string -> DataSet
protected function ExecuteSqlWithResults(
server : Server,
cmd : String
) : DataSet
Parameters
- server
Type: Microsoft.SqlServer.Management.Smo.Server
A Server object that specifies the instance of SQL Server on which to execute the batch of Transact-SQL statements.
- cmd
Type: System.String
A StringCollection system object that contains the batch of Transact-SQL statements to be executed.
Return Value
Type: System.Data.DataSet
A DataSet system object that contains the results sets returned by the executed Transact-SQL command batch.
Examples
Backing Up and Restoring Databases and Transaction Logs
See Also
Reference
Microsoft.SqlServer.Management.Smo Namespace