MSSQL存储过程转换为MYSQL存储过程(300分)

  • 主题发起人 主题发起人 jxgxy
  • 开始时间 开始时间
J

jxgxy

Unregistered / Unconfirmed
GUEST, unregistred user!
--ID注册<br>CREATE PROCEDURE [dbo].[Add_User]<br>&nbsp;@uid char(18)='',@password char(64)=''<br>AS<br>begin tran<br>&nbsp; if @uid='' or @uid=null<br>&nbsp; begin<br>&nbsp; &nbsp; ROLLBACK<br>&nbsp; &nbsp; return (1) --ID不能为空<br>&nbsp; end<br>&nbsp; if @password='' or @password=null<br>&nbsp; begin<br>&nbsp; &nbsp; ROLLBACK<br>&nbsp; &nbsp; return (2) --密码不能为空<br>&nbsp; end<br>&nbsp; if exists(select cdkey from dbo.CSL_CDKEY where cdkey=@UID)<br>&nbsp; begin<br>&nbsp; &nbsp; ROLLBACK<br>&nbsp; &nbsp; return (3) --ID已存在<br>&nbsp; end<br>&nbsp; insert into dbo.CSL_CDKEY(cdkey,password)values(@uid,@password)<br>&nbsp; if (@@error&gt;0)<br>&nbsp; begin<br>&nbsp; &nbsp; ROLLBACK<br>&nbsp; &nbsp; return (4) --失败,未知错误,请稍候再试。<br>&nbsp; end<br>commit<br><br><br>以上是MSSQL的存储过程,帮忙转成MYSQL的存储过程,谢谢。<br><br>(MYSQL5.0以上版本支持存储过程)
 
帮帮手啊...
 
请参阅MYSQL存储过程语法
 
接受答案了.
 
后退
顶部