Call Sproc on another SQL Server without contacting via TSQL

I want to call sproc on server B from server A in TSQL without referencing the servers. Is it possible to use something like a connection string to execute this sproc? Return will be the only nvarchar value.

Sincerely.

+3
source share
2 answers

To avoid "linked servers", you usually use OPENDATASOURCE

After the comment:

EXEC OPENDATASOURCE('SQLNCLI', 'Data Source=London\Payroll;Integrated Security=SSPI').remoteDB.remoteSchema.remoteProc @param1, @param2,...

Simple naming convention for parts. All OPENDATASOURCE just replaces the name of the linked server ...

Note: problems with " adhoc access " may occur .

+7
source

, ...

  • ,
  • , xp_cmdshell, isql . (, sql, isql )

-don

0

Source: https://habr.com/ru/post/1719340/


All Articles