The ExecuteImmediate method connects to a linked server or remote server data source, executes a Transact-SQL command batch on the connection, and disconnects.
| LinkedServer Object | RemoteServer Object |
object.ExecuteImmediate( Command , [ Length ] )
| Part | Description |
|---|---|
| object | Expression that evaluates to an object in the Applies To list. |
| Command | String specifying a Transact-SQL command batch. |
| Length | Optional. Long integer indicating the statement batch length. |
When using the ExecuteImmediate method with the LinkedServer object, command batch syntax is provider-specified. For more information, see your OLE DB provider documentation.
HRESULT ExecuteImmediate(
SQLDMO_LPCSTR Command,
long lLength CPPDEFAULT(= 0));