Executes a Transact-SQL statement on a database. Returns any SQL Server messages received, including output from PRINT and DBCC statements. Returns results in a QueryResults object.
QueryResults = Database.ExecuteWithResultsAndMessages (
[Command :=] strSQLStatement,
[[Messages :=] strMessages] )
HRESULT pDatabase->ExecuteWithResultsAndMessages (
SQLOLE_LPCSTR strSQLStatement,
LPSQLOLEQUERYRESULTS* ppQueryResults,
SQLOLE_LPBSTR pstrMessages = 0 );
Element | Type | Description |
---|
QueryResults | QueryResults | Returned QueryResults object |
strSQLStatement | String | SQL statement |
strMessages | String | Returned SQL Server messages |
The contents of the QueryResults object depend on the Transact-SQL statement.
If a ServerSink object is configured to receive SQLServer events, the SQL Server messages are also sent to the ServerSink.ServerMessage method.
EXECUTE