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?
A:
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.
Dwight T
2009-05-05 18:41:17
A:
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()
Turbo
2009-05-07 01:45:03