JET 和 SQL Server 支持分层行集吗?
OLE DB 文档记录了分层行集功能 ,带有 SQL 示例,但没有表明哪些数据库提供商支持它。 JET 和 SQL Server 支持此功能吗?他们使用与文档中相同的语法,还是他们自己的扩展语法?
The OLE DB documentation documents a hierarchial rowset feature, with SQL examples, but doesn't indicate what DB providers support it. Do JET and SQL Server support this feature? And do they use the same sort of syntax as in the documentation, or their own extended syntax?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,支持。我过去经常使用它。使用数据调整服务 随 MDAC 一起提供(在名为 Msadds.dll 的文件中)。 OLE DB 提供程序名为
MSDataShape
,您可以使用 SHAPE 命令 产生分层结果。连接字符串语法类似于以下内容:Jet:
SQL Server:
一些值得注意的事情:
SHAPE 语法可以变得非常
像你一样笨拙(而且笨拙)
查询变得更加复杂,所以保持
记住这一点。
如果您使用 .NET,则可以使用
DataSet
和DataRelation
类实现相同的功能。更重要的是,文档明确指出:
Yes, it is supported. I've used it quite a bit in the past. This functionality was available using the Data Shaping Service that shipped with MDAC (in a file named Msadds.dll). The OLE DB provider is named
MSDataShape
and you would use the SHAPE command to produce hierarchical results. The connection string syntax resembled the following:Jet:
SQL Server:
A few things worth noting:
The SHAPE syntax can get very
unwieldy (and awkward) as your
queries become more complex, so keep
this in mind.
If you are using .NET, the same functionality can be achieved with
DataSet
andDataRelation
classes.More importantly, the documentation clearly states that:
这不是您问题的直接答案,因此如果您必须使用分层行集,请忽略它。
我记得大约 9 年前读过有关此功能的文章,但此后就再也没有看到它被使用过。我认为事实证明这是一条错误的道路。另一方面,我确实经常使用公用表表达式(尤其是递归表达式),并发现它们具有很大的价值(http://msdn.microsoft.com/en-us/library/ms186243.aspx)。
我认为分层行集应该做的是对象关系映射,而这些行集无论如何都不能构成良好的 ORM(NHibernate 更好)。
It's not a direct answer to your question, so if you must use hierarchical rowsets just ignore it.
I remember reading about this feature some 9 years ago but have not seen it being used since. I think it's proven to be wrong way to go. On the other hand, I did use common table expressions (and recursive ones in particular) a lot and found them of great value (http://msdn.microsoft.com/en-us/library/ms186243.aspx).
I think what was supposed to be done by hierarchical rowsets is object-relational mapping and those rowsets do not make good ORM anyway (NHibernate is much better).