mysql的存储过程怎么写

2025-03-11 14:19:37
推荐回答(1个)
回答1:

比如
if exists (select name from sysobjects where name = 'proc_ManagerLogin')
begin
drop procedure proc_ManagerLogin
end
go

create procedure proc_ManagerLogin
@return bit output ,@username varchar(59),@password varchar(32)
as
begin
if exists(select * from systemManager where adminName=@username and adminpass=@password)
begin
set @return=1
--在系统日志中记录
exec proc_SystemLog_add '管理员登陆','进入了后台'
end
else

begin
set @return=0
end
end
go