ALTER PROCEDURE dbo.StoredProcedure1
AS
DECLARE @Seedid int, @data1 float, @data2 float, @g geometry
DECLARE member_cursor CURSOR FOR
SELECT id from test1 ;
OPEN member_cursor;
FETCH NEXT FROM member_cursor
INTO @Seedid ;
WHILE @@FETCH_STATUS = 0
BEGIN
select @data1 =data1 from test where id=@Seedid
select @data2 =data2 from test where id=@Seedid
update test1
set data4 = geometry::STGeomFromText('POINT (@data1 @data2)', 0)
where id=@Seedid;
-- This is executed as long as the previous fetch succeeds.
FETCH NEXT FROM member_cursor
INTO @Seedid ;
END
RETURN
CLOSE member_cursor;
DEALLOCATE member_cursor;
我收到以下错误:
该语句已终止。
在执行用户定义的例程或聚合“几何”期间发生 .NET Framework 错误:
System.FormatException:24141:输入的位置 13 处应有一个数字。输入有@data1。