我正在设计一个访问链接服务器中的表的视图。
每次我将此查询粘贴到 SQL 窗格中时,Intellisense 都会删除方括号,然后抱怨有超过 3 个前缀。我试过关闭 Intellisense,但它一直在发生:
SELECT Loc.Address1, Loc.Address2, Loc.Address3, BP.BusinessPartnerName
FROM [REPORTING.SOMESERVER.CA].Toast.dbo.BusinessPartnerLocations AS Loc LEFT OUTER JOIN
[REPORTING.SOMESERVER.CA].Toast.dbo.BusinessPartner AS BP ON Loc.BusinessPartnerID = BP.BusinessPartnerID
对此:
SELECT Loc.Address1, Loc.Address2, Loc.Address3, BP.BusinessPartnerName
FROM REPORTING.SOMESERVER.CA.Toast.dbo.BusinessPartnerLocations AS Loc LEFT OUTER JOIN
REPORTING.SOMESERVER.CA.Toast.dbo.BusinessPartner AS BP ON Loc.BusinessPartnerID = BP.BusinessPartnerID
似乎将服务器名称封装在引号中会使 Intellisense 忽略它。