PROCEDURE [dbo].[setInfo] @Dt YfInfo READONLY, //用户定义表类型
AS
BEGIN
Declare @NowPh nvarchar(20) = null;
Declare @OldPh nvarchar(20) = null;
Declare Gravida_Cursor CURSOR FOR
select [批号]
from @Dt
order by [批号]
open Gravida_Cursor
Fetch next From Gravida_Cursor Into @NowPh WHILE (@@FETCH_STATUS = 0)
begin
set @OldPh = @NowPh
end
Close Gravida_Cursor
Deallocate Gravida_Cursor
END在执行到 WHILE (@@FETCH_STATUS = 0) 执行不过去 超时,请高手指点
AS
BEGIN
Declare @NowPh nvarchar(20) = null;
Declare @OldPh nvarchar(20) = null;
Declare Gravida_Cursor CURSOR FOR
select [批号]
from @Dt
order by [批号]
open Gravida_Cursor
Fetch next From Gravida_Cursor Into @NowPh WHILE (@@FETCH_STATUS = 0)
begin
set @OldPh = @NowPh
end
Close Gravida_Cursor
Deallocate Gravida_Cursor
END在执行到 WHILE (@@FETCH_STATUS = 0) 执行不过去 超时,请高手指点
AS
BEGIN
Declare @NowPh nvarchar(20) = null;
Declare @OldPh nvarchar(20) = null;Declare Gravida_Cursor CURSOR FOR
select [批号]
from @Dt
order by [批号]open Gravida_CursorFetch next From Gravida_Cursor Into @NowPhWHILE (@@FETCH_STATUS = 0)
begin
set @OldPh = @NowPh
Fetch next From Gravida_Cursor Into @NowPh
end
Close Gravida_Cursor
Deallocate Gravida_Cursor
END
begin
set @OldPh = @NowPh
Fetch next From Gravida_Cursor Into @NowPh
end 少了這一段