输入banner图图片脚本导航/分类

Sqlserver 计算两坐标距离函数

exists (select * from dbo.sysobjects where id = object_id(NUF_ETL_GetDistance) and xtype in (NFN, NIF, NTF)) drop function UF_ETL_GetDistance GO CREATE FUNCTION UF_ETL_GetDistance ( @sLng DECIMAL(12,6), @sLat DECIMAL(12,6), @eLng DECIMAL(12,6), @eLat DECIMAL(12,6) ) RETURNS DECIMAL(12,4) AS BEGIN DECLARE @result DECIMAL(12,4) SELECT @result = 6378137.0*ACOS(SIN(@sLat/180*PI())*SIN(@eLat/180*PI())+COS(@sLat/180*PI())*COS(@eLat/180*PI())*COS((@sLng-@eLng)/180*PI())) RETURN @result/1000 END go

 

Sqlserver 计算两坐标距离函数

标签:cts   col   type   exists   nbsp   drop   cos   etl   distance