将点从 SQL Server Multipoint 数据类型加载到表中

发布于 2024-07-19 15:29:51 字数 125 浏览 5 评论 0原文

我正在考虑使用新的几何数据类型来表示数据库中的向量的想法。 多点几何数据类型对此很有效,但我的问题是,有没有一种方法可以用多点中的 x,y 值填充两列表,其中每个点都是表中的一行,并且 X 和Y 点值分别放在第 1 列和第 2 列中?

I'm kicking around the idea of using the new geometry datatype to represent a vector in the database. The multipoint geometry data type would work well for this, but my question is, is there a way to populate a two column table with the x,y values in a multipoint, where each point is a row in the table, and the X and Y point values go in column1 and column2 respectively?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

行雁书 2024-07-26 15:29:51

我假设您已阅读几何数据类型入门。

http://msdn.microsoft.com/en-us/library/bb895270。 aspx

除此之外,我无法提供更多帮助。

I'm assuming you have read the Getting Started with the geometry Data Type.

http://msdn.microsoft.com/en-us/library/bb895270.aspx

Beyond that, I can't help with more.

她说她爱他 2024-07-26 15:29:51

弄清楚了:

select
mp.id
,mp.vector.STPointN(nums.number).STX
,mp.vector.STPointN(nums.number).STY
,nums.number
from tblWithMultiPoints mp --table with an int id, and a multipoint called vector
,#NUMBERS nums --temp table with 1 - max num of points in any multipoint
where nums.number <= mp.vector.STNumPoints()

Figured it out:

select
mp.id
,mp.vector.STPointN(nums.number).STX
,mp.vector.STPointN(nums.number).STY
,nums.number
from tblWithMultiPoints mp --table with an int id, and a multipoint called vector
,#NUMBERS nums --temp table with 1 - max num of points in any multipoint
where nums.number <= mp.vector.STNumPoints()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文