Executes a Transact-SQL statement on a remote server. Returns any SQL Server messages received, including output from PRINT and DBCC statements. Returns results in a QueryResults object.
QueryResults = RemoteServer.ExecuteWithResultsAndMessages (
[Command :=] strSQLStatement,
[[Messages :=] strMessages] )
HRESULT pRemoteServer->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.
sp_sqlexec