T-SQL 旧式连接 *= 和 =* [英] T-SQL Old style joins *= and =*
问题描述
我们有大约 150 个使用 *= 和 =* 类型 ANSI92 的旧式查询和视图?加入.有没有人知道可以帮助转换的工具/方法或脚本,或者我们是否必须遍历所有 150 个.
We have about 150 old style queries and views that use the *= and =* type ANSI92? join. Does anybody know of a tool / method or script that could help with the conversion or do we have to just slog through all 150 of them.
谢谢
Select PapersSent,
DateSent,
Code,
ActionDate,
ClientAction,
ClientContactRef,
PublishAppraisal,
PublishCV,
SponsorContactREF,
MeetingNotes,
InternalNotes,
Contact_AdminAction,
MeetingLocation
from tblMeetingNotes a,
tblPapersOptions b,
tblContactLog c
where a.CREF=@CREF and
a.CLID=@CLID AND
Isnull(PapersSent,0)*=Value AND
a.CREF*=c.CREF AND
a.CLID*=c.Contact_ID
推荐答案
这可能不是您希望听到的,但这种类型的工具并不存在.在某些情况下,旧样式的 JOIN 不会完全转换为 SQL-92 样式,从而导致查询给出不同的结果,甚至需要重新编写查询.
This probably isn't what you were hoping to hear, but this type of tool doesn't exist. There are situations where an old style JOIN won't cleanly convert to the SQL-92 style, causing the query to give different results, or even requiring the query to be re-written.
即使有一个工具可以自动转换连接,您仍然需要测试每个查询以确保它按照您想要的方式转换,创建的工作可能与通过以下方式完成的工作一样多手.
Even if there were a tool to automatically convert the joins, you would still need to test every query to make sure that it converted how you wanted it to, creating probably just as much work as it would have been to do it by hand.
Erland Sommarskog 有一个关于如何快速将旧样式连接转换为 SQL-92 的很好的分步过程:http://www.sommarskog.se/Become-an-ANSI-star.doc
Erland Sommarskog has a good step-by-step process on how you would quickly convert the old style joins to SQL-92: http://www.sommarskog.se/Become-an-ANSI-star.doc
这篇关于T-SQL 旧式连接 *= 和 =*的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!