次の方法で共有


BackupRestoreBase.ExecuteSqlWithResults メソッド

SQL Server の指定したインスタンスについて 1 つ以上の結果セットが返される必要のある、Transact-SQL ステートメントのバッチを実行します。

名前空間:  Microsoft.SqlServer.Management.Smo
アセンブリ:  Microsoft.SqlServer.SmoExtended (Microsoft.SqlServer.SmoExtended.dll)

構文

'宣言
Protected Function ExecuteSqlWithResults ( _
    server As Server, _
    cmd As String _
) As DataSet
'使用
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

パラメーター

  • cmd
    型: System.String
    実行される Transact-SQL ステートメントのバッチを含む StringCollection システム オブジェクトです。

戻り値

型: System.Data.DataSet
実行される Transact-SQL コマンド バッチから返される結果セットを含む DataSet システム オブジェクトです。

使用例

データベースおよびトランザクション ログのバックアップと復元

関連項目

参照

BackupRestoreBase クラス

Microsoft.SqlServer.Management.Smo 名前空間

その他の技術情報

RESTORE (Transact-SQL)

BACKUP (Transact-SQL)