The ExecuteWithResults method executes a Transact-SQL command batch returning batch result sets in a QueryResults object.
Database Object | RemoteServer Object |
LinkedServer Object | SQLServer Object |
object.ExecuteWithResults( Command , [ Length ] ) as QueryResults
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list. |
Command | String specifying a Transact-SQL or provider-specific command batch. |
Length | Optional. Long integer indicating the statement batch length. |
A QueryResults object.
When using the ExecuteWithResults method with the LinkedServer object, command batch syntax is provider-specified. For more information, see your OLE DB provider documentation.
HRESULT ExecuteWithResults(
SQLDMO_LPCSTR Command,
LPSQLDMOQUERYRESULTS* ppResults,
long lLength CPPDEFAULT(= 0));