请教各位大牛,下面一段sql在sql server上可以执行,但是在MySQL5.1上却不行,
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 create UNIQUE index gkcf_index on gkcf (KSH)
go PROC_MAKEGKCF 1,100000
go
报错是: Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'go
create PROCEDURE PROC_MAKEGKCF
(
@start INT,
@stop INT
) TYPE' at line 11
(0 ms taken)
第十一行就是第一个go那一行 |