mysql的存储过程怎么写
1个回答
2014-02-19
展开全部
比如
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
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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询