CREATE PROCEDURE dbo.usp_test1 AS
create table #temp(names varchar(8))
insert into #temp values('test1')
insert into #temp values('test2')
select * from #temp
drop table #temp
GO
CREATE PROCEDURE [dbo].[usp_test2] AS
create table #test(names varchar(8))
insert #test exec dbo.usp_test1
DECLARE test_cursor CURSOR
FOR SELECT * FROM #test
OPEN test_cursor
FETCH NEXT FROM test_cursor
FETCH NEXT FROM test_cursor
close test_cursor
deallocate test_cursor
GO
急,谁可以给例子?
set @sql='GetFluxWithDateAndCoach ''' +@start_date +''','''+@end_date+''','''+@coach+''''
declare fluxs scroll cursor for
@sql
open fluxs
fetch next from fluxs into @fluxstation
close fluxs
deallocate fluxs
这儿执行不正确,该如何写?