SQL Servr 2008空间数据应用系列六:基于SQLCRL的空间数据可编程(5)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-17 14:38 点击:次
== ConnectionState.Closed) conn.Open();
using (var cmd = new SqlCommand(sql, conn))
{
int row = cmd.ExecuteNonQuery();
}
}
}
using (var cmd = new SqlCommand(sql, conn))
{
int row = cmd.ExecuteNonQuery();
}
}
}
三、查询数据库空间数据
首先来看看基于SQL Server Management Studio 查询刚刚入库的记录,通过空间结果可以直接预览查询结果。
declare @city geometry;
select @city = CityLocation from Cities where ID=5;
select @city;
select @city.STArea() as 面积;--求面积
---------------------------------------------------------------------------------------------------------------------------------------
0x000000000104080000000000000008815CC035B18AA70A0045400000000070825CC035B18AA70A00454000000000A07F5CC0CECAEE93928242400000000038435BC0CECAEE93928242400000000008465BC0BCF1C323AC8144400000000098C45BC01572BD6EEA8544400000000098C45BC035B18AA70A0045400000000008
(1 行受影响)
面积
----------------------
22.6802255629445
(1 行受影响)
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>