Page tree
Skip to end of metadata
Go to start of metadata

EBIFlow sistemleri arasında kullancı bilgisi eşlemek için aşağıdaki sorgu kullanılabilir. 

Linked server - SQL
declare @linkedservername as nvarchar(100)
Set @linkedservername = '1.1.1.1\SQLSRV'

declare @dbname as nvarchar(100)
Set @dbname = 'EBIFlowDB'


DECLARE @sql nvarchar(MAX);
SET @sql='
INSERT INTO schPerson 
select * from ['+@linkedservername+'].'+@dbname+'.dbo.schPerson 
where Id not in (select Id from schPerson)

INSERT INTO schUser
select * from ['+@linkedservername+'].'+@dbname+'.dbo.schUser 
where Id not in (select Id from schUser)

INSERT INTO schEmployee
select * from ['+@linkedservername+'].'+@dbname+'.dbo.schEmployee 
where Id not in (select Id from schEmployee)

INSERT INTO schLocation
select * from ['+@linkedservername+'].'+@dbname+'.dbo.schLocation 
where Id not in (select Id from schLocation)

INSERT INTO schOrganizationalUnit
select * from ['+@linkedservername+'].'+@dbname+'.dbo.schOrganizationalUnit 
where Id not in (select Id from schOrganizationalUnit)

INSERT INTO schOrganizationalUnitMember
select * from ['+@linkedservername+'].'+@dbname+'.dbo.schOrganizationalUnitMember 
where Id not in (select Id from schOrganizationalUnitMember)
'

exec (@sql)

 

Ayrıca Bakınız

SQL Linked Servers nasıl kullanılır?

  • No labels