create table gkcf (
KSH CHAR(14) not null,
KH CHAR(9) not null,
XM CHAR(9) not null,
KM1 INT,
KM2 INT,
KM3 INT,
KM4 INT,
KM5 INT,
ZF INT )
go
create PROCEDURE PROC_MAKEGKCF
(
@start INT,
@stop INT
)
begin
declare @cur INT
declare @km1 int
declare @km2 int
declare @km3 int
declare @km4 int
declare @km5 int
declare @zf int
Select @cur=@start
While @cur<
=@stop
begin
Select @km1=CONVERT(INT,RAND()*100)
Select @km2=CONVERT(INT,RAND()*100)
Select @km3=CONVERT(INT,RAND()*100)
Select @km4=CONVERT(INT,RAND()*100)
Select @km5=CONVERT(INT,RAND()*100)
Select @zf=@km1+@km2+@km3+@km4+@km5
insert into gkcf values(CONVERT(CHAR(14), @cur),CONVERT(CHAR(9), @cur),'测试',@km1,@km2,@km3,@km4,@km5,@zf)
Select @cur=@cur+1
end
end
go