我在地理围栏表中有经度和纬度如何检查数据库级别的经度和纬度。如果汽车经度纬度位于区域内,则更新地理位置栏区域='区域内的汽车'
CREATE TRIGGER Tr_CheckGeoFance
ON CheckGeoFance
AFTER INSERT AS
BEGIN
Update tblgeofencing
Set CarZone ='Car In Zone Area'
END
GO
ShapesString ={"shapes":[{"type":"rectangle","color":"#1E90FF","bounds":{"northEast":{"lat":"32.379961464357315","lon":"70.99365234375"},"southWest":{"lat":"31.840232667909362","lon":"70.2685546875"}}}]}
答案 0 :(得分:0)
首先你必须解码当前为json格式的ShapesString,然后从解码的json中找出纬度和经度。 然后检查定义范围内的lat-long谎言以更新列。
请参考此解码json: - Parse JSON in TSQL