SQL 系统表应用
Posted HelloHongFu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL 系统表应用相关的知识,希望对你有一定的参考价值。
查看link server
select DD.System,DD.DB,DD.previous_processing_dte, DD.processing_dte,LS.LinkServerName,LS.DBServer,ServerList.ServerName from DD
INNER JOIN
(
SELECT a.name as LinkServerName,data_source as DBServer
FROM sys.Servers a
LEFT OUTER JOIN sys.linked_logins b ON b.server_id = a.server_id
LEFT OUTER JOIN sys.server_principals c ON c.principal_id = b.local_principal_id
) LS
on DD.LinkServerName = LS.LinkServerName
LEFT JOIN
(
select ServerName,HostName + ‘,‘ + SQLPort as DBServer from conf.DBServerList
union
select ServerName,‘.,1443from conf.DBServerList
where HostName = @@SERVERNAME
) ServerList
on LS.DBServer = ServerList.DBServer
以上是关于SQL 系统表应用的主要内容,如果未能解决你的问题,请参考以下文章