????step4???????????????????
create view dbo.view_Person
as
select [PersonID]
??[PersonType]
??[FirstName]
??[MiddleName]
??[LastName]
from [dbo].[Person]  with(nolock)
where [PersonType] in('IN'??'EM'??'SP')
union all
select [PersonID]
??[PersonType]
??[FirstName]
??[MiddleName]
??[LastName]
from db1.[DBTest2].[dbo].[Person] with(nolock)
where [PersonType] in('SC'??'VC'??'GC')
with check OPTION;
????Step5??????????????????м??
????SELECT *
????from dbo.view_Person p
????where p.PersonType in ('em'??'sc')
????Step6?????
?????????????????????????????????????OPENQUERY??????м??????????????????????????
????1?????OpenQuery??????DTC????
create view dbo.view_Person
as
select [PersonID]
??[PersonType]
??[FirstName]
??[MiddleName]
??[LastName]
from [dbo].[Person]  with(nolock)
where [PersonType] in('IN'??'EM'??'SP')
union all
select [PersonID]
??[PersonType]
??[FirstName]
??[MiddleName]
??[LastName]
from OPENQUERY ( db1 ??
N'select [PersonID]
??[PersonType]
??[FirstName]
??[MiddleName]
??[LastName]
from db1.[DBTest2].[dbo].[Person] with(nolock)
where [PersonType] in(''SC''??''VC''??''GC'')' ) as p
with check OPTION;
????2????Local Server????·??????
update db1.DBTEST2.dbo.person
set FirstName=N'Harm'
where PersonId=102;
--????
exec db1.DBTEST2.sys.sp_executesql N'update dbo.person
set FirstName=N''Harm''
where PersonId=102;'
Appendix
--SQL Server ????????? 'Ad Hoc Distributed Queries'
exec sp_configure 'show advanced options'??1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries'??1
reconfigure
--??????????Ad Hoc Distributed Queries??
exec sp_configure 'Ad Hoc Distributed Queries'??0
reconfigure
exec sp_configure 'show advanced options'??0
reconfigure