【问题标题】:Load points from SQL Server Multipoint data type into table将点从 SQL Server Multipoint 数据类型加载到表中
【发布时间】:2009-05-05 15:13:57
【问题描述】:

我正在考虑使用新的几何数据类型来表示数据库中的向量。多点几何数据类型可以很好地解决这个问题,但我的问题是,有没有办法用多点中的 x、y 值填充两列表,其中每个点是表中的一行,而 X 和Y点值分别在column1和column2?

【问题讨论】:

    标签: sql-server sql-server-2008 geometry multipoint


    【解决方案1】:

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

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

    除此之外,我无能为力。

    【讨论】:

      【解决方案2】:

      想通了:

      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()
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-04-04
        • 1970-01-01
        • 2015-03-21
        • 2020-04-04
        • 1970-01-01
        • 2016-02-04
        相关资源
        最近更新 更多