首页 新闻 会员 周边

sql语句 怎么总报@id附近有语法错误??

0
悬赏园豆:10 [已关闭问题] 关闭于 2014-05-18 08:29

declare @id int;
set @id=100;
while @id>0
begin
    if @id%2=0
        begin
            insert into ListTable(RegName,Referrer,NetWorkStatu,PagTime,NetWorkSource,OtherGetBag,IGetBag) values ('某某公司名称某某公司名称','张亭之',0,null,'二维码','1个月高级模式','1个月高级模式');
    
        end    
    else if(@id%3=0)        
        begin
            insert into ListTable(RegName,Referrer,NetWorkStatu,PagTime,NetWorkSource,OtherGetBag,IGetBag) values ('某某公司名称某某公司名称','张亭之',2,null,'二维码',null,'1个月高级模式');
        end    
    else
        begin
            
            insert into ListTable(RegName,Referrer,NetWorkStatu,PagTime,NetWorkSource,OtherGetBag,IGetBag) values ('某某公司名称','李晓明',1,null,'二维码','1个月高级模式',null)    ;
        end    
    @id=@id-1;
end   

fulai_xy的主页 fulai_xy | 初学一级 | 园豆:5
提问于:2014-05-18 08:26
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册