我刚刚将我的 SQL Server 数据库从 2000 升级到 2005,兼容模式为 90,现在我发现我有一些使用非 ANSI 连接运算符的查询,这些在 SQL Server 2005 中不完全支持。所以我需要转换以下代码转换为符合 ANSI 的格式。
FROM gaf (nolock),
gaf_dress as D (nolock index = pkgaf_DRESS_GUM),
gaf_dress as M (nolock index = pkgaf_DRESS_GUM),
mobile (nolock index = pkmobileID),
Quest (nolock index = pkQuestID)
WHERE
gaf.ID = mobile.ID
and gaf.DRESS_GUM_1 *= D.DRESS_GUM
and gaf.DRESS_GUM_2 *= M.DRESS_GUM
and gaf.ID *= Quest.ID
and gaf.RECORD=1
and na2.PURPOSE <> 'Doore'
and gaf.PD_THRU > dateadd(dd, -1, dateadd(mm, -13, convert(datetime, convert(varchar(6),
getdate(), 112) + '01')))
任何帮助将不胜感激。
我以前试过这个
FROM Name (nolock)inner join mobile
on Name.ID = Demographics.ID left outer join NA1
on Name.ADDRESS_NUM_1 = NA1.ADDRESS_NUM left outer join NA2
on Name.ADDRESS_NUM_2 = NA2.ADDRESS_NUM left outer join ACSW
on Name.ID = ACSW.ID
;with Name_Address (nolock,(index(pkName_AddressADDRESS_NUM)))as NA1
;with Name_Address (nolock, (index(pkName_AddressADDRESS_NUM))as NA2 ;with mobile(nolock,
(index (pkmobileID))
;with ACSW (nolock, (index (pkACSWID)))
WHERE gaf.MEMBER_RECORD=1
and na2.PURPOSE <> 'MAIN'
and gaf.PAID_THRU > dateadd(dd, -1, dateadd(mm, -13, convert(datetime,
convert(varchar(6), getdate(), 112) + '01')))
但它向我抛出了这个错误“Msg 102, Level 15, State 1, Line 302 Incorrect syntax near '('.”</p>