次の方法で共有


ExecuteWithResultsAndMessages2 Method

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The ExecuteWithResultsAndMessages2 method executes a Transact-SQL command batch returning batch result sets in a QueryResults object and capturing messages raised as part of command batch execution.

構文

object
. ExecuteWithResultsAndMessages2(
Command 
,
Messages
, [ Length ] ) asQueryResults

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • Command
    String that specifies a Transact-SQL or provider-specific command batch.
  • Messages
    String used to return message output.
  • Length
    Optional. A long integer that indicates the statement batch length.

Prototype (C/C++)

Not applicable

Returns

A QueryResults object that contains command batch results. The method fills the string specified by the Messages argument with message returns, if any are generated by batch execution.

解説

For Microsoft SQL Server, error severity indicates the degree of an error condition. Some errors are severe enough to terminate statement execution prematurely. Any error with a severity of 10 or higher is returned to the SQL Distributed Management Objects (SQL-DMO) application through normal error handling.

Minor errors, SQL Server errors with a severity of less than 10, indicate that statement execution succeeded, but that success was conditional. These are called Success-with-information errors. Some Transact-SQL statements, such as the PRINT statement, do not generate result sets, but use messages for their return value.

The ExecuteWithResultsAndMessages method implements command batch execution for a SQL-DMO application, allowing the application to capture success-with-information errors or other information transmitted as messages.

ms135076.note(ja-jp,SQL.90).gifメモ :
Visual Basic applications should call ExecuteWithResultsAndMessages2 instead of ExecuteWithResultsAndMessages because the Length parameter is not optional in the original ExecuteWithResultsAndMessages method. ExecuteWithResultsAndMessages2 is not available to C++ applications, which should call ExecuteWithResultsAndMessages.

ExecuteWithResultsAndMessages2 can be used with SQL Server 7.0 and SQL Server 2000 or later.

Applies To:

Database2 Object

RemoteServer2 Object

LinkedServer2 Object

SQLServer2 Object

参照

関連項目

ExecuteWithResultsAndMessages Method

ヘルプおよび情報

SQL Server 2005 の参考資料の入手