When I tried this script, I got an error indicating that the login had failed. However, I am able to initiate a connection with the server normally from the SSMS environment
USE MyDB;
GO
TRUNCATE TABLE MyDB.dbo.MyTable
EXEC sp_addlinkedserver 'MySer', N'SQL Server';
EXEC sp_addlinkedsrvlogin 'MySer', 'false', 'Uname', 'pw';
INSERT INTO dbo.MyTable (ID, Name, NameEn, Acronym)
SELECT
r.R_Id,
r.R_Desc,
r.R_Desc_E,
''
FROM
MySer.RemoteDB.dbo.RemoteTable r;
1条答案
按热度按时间km0tfn4u1#
For your linked server add datasource and catalog.