sp_linkedservers
set xact_abort on
begin DISTRIBUTED transaction
exec sp_addlinkedserver 'Log1','SQL Server'
exec sp_addlinkedsrvlogin 'Log1','false','log2\webuser','super','super'
--select * from log1,lzy1.dbo.test1
--select * from openquery (Log1, 'select * from database1.dbo.test1')
--select * from openrowset('SQLOLEDB','log1';'sa';'sa','SELECT * FROM database1.dbo.test1')
commit tran