如何将其从 MS SQL SERVER 转换为 MySQL?
/****** Object: StoredProcedure [dbo].[geolocation_refresh_geography] Script Date: 05/08/2012 22:02:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[geolocation_refresh_geography]
as
update locations
SET geolocation = geography::STPointFromText('POINT(' + CAST([Longitude] AS VARCHAR(20)) + ' ' + CAST([Latitude] AS VARCHAR(20)) + ')', 4326)
where geolocation is null
GO
我的代码在第 4 行导致错误,不知道为什么?
create procedure geolocation_refresh_geography()
BEGIN
update locations
SET geolocation = geography::STPointFromText('POINT(' + CAST(Longitude AS VARCHAR(20)) + ' ' + CAST(Latitude AS VARCHAR(20)) + ')', 4326)
where geolocation is null
END