2009-05-05 50 views
0

我在使用新幾何數據類型來表示數據庫中的向量。多點幾何數據類型適用於此,但我的問題是,有沒有辦法在多點中使用x,y值填充兩列表格,其中每個點是表格中的一行,而X和Y點值分別進入第1列和第2列?將SQL Server多點數據類型的加載點加載到表中

回答

0

想通了:

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() 
相關問題