首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

帮忙看一下,该怎么处理

2012-01-19 
帮忙看一下SELECTHardwareType,Model,[ID],KB_NetAssets.Mac,[Name],[User],Department,StrategyGroup,Loc

帮忙看一下
SELECT   HardwareType,Model,[ID],KB_NetAssets.Mac,[Name],[User],Department,StrategyGroup,Location,AlertManageType,Brand,Provider  
FROM     KB_NetAssets   INNER   JOIN     KB_NetAsset_RealtimePCEquipments   ON   KB_NetAssets   .Mac=KB_NetAsset_RealtimePCEquipments   .Mac  
With   NOLOCK  
WHERE   (KB_NetAsset_RealtimePCEquipments.HardwareType= 'IP '  
OR   KB_NetAsset_RealtimePCEquipments.HardwareType= 'HostName '
OR   KB_NetAsset_RealtimePCEquipments.HardwareType= 'HostUser ')
AND   KB_NetAssets.Status!=0  

ORDER   BY   KB_NetAssets.Mac   ,HardwareType  
//////////////////
服务器:   消息   156,级别   15,状态   1,行   5
在关键字   'With '   附近有语法错误。

怎么改呢?

[解决办法]
WITH (NOLOCK)

[解决办法]
SELECT
HardwareType,
Model,
[ID],
KB_NetAssets.Mac,
[Name],
[User],
Department,
StrategyGroup,
Location,
AlertManageType,
Brand,
Provider
FROM
KB_NetAssets WITH(NOLOCK)
INNER JOIN
KB_NetAsset_RealtimePCEquipments WITH(NOLOCK)
ON
KB_NetAssets.Mac=KB_NetAsset_RealtimePCEquipments.Mac
WHERE
(KB_NetAsset_RealtimePCEquipments.HardwareType= 'IP '
OR KB_NetAsset_RealtimePCEquipments.HardwareType= 'HostName '
OR KB_NetAsset_RealtimePCEquipments.HardwareType= 'HostUser ')
AND KB_NetAssets.Status!=0
ORDER BY
KB_NetAssets.Mac ,HardwareType

--try

热点排行