SQL Server copies table data between databases

I have a script that I use to copy data from a table in one database to a table in another database on one instance of SQL Server. The script works fine when I am connected to an instance of SQL Server like me, as I have access to both databases. The problem is that this will not happen on the client SQL Server. They have separate logins for each database (SQL authentication accounts). Does anyone know if there is a way to run a script in these circumstances. the script will do something like.

use sourceDB
Insert targetDB.dbo.tblTest (id, test_name)
Select id, test_name from dbo.tblTest

thank

+3
source share
3 answers

. , , . , .

+1

, .

sp_addlinkedsrvlogin 'myDBservername',false,'db_a','db_b','db_b_123'
0

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


All Articles