-- =============================================
-- Author: wjb
-- Create date: 07/17/2008
-- Description: 添加管理员信息
-- =============================================
create procedure [dbo].[Proc_manage_addUserInfo]
(
@userCode varchar(100),
@passWord varchar(100),
@isActive bit,
@roleID int
)
as
begin
declare @temp varchar(100)
declare @return int
set @temp=newid()
begin tran --或transaction
insert into T_admin_userInfo (userid,userCode,passWord,isActive,lastLogin) values (@temp,@userCode,@passWord,@isActive,getdate())
--关联role表:
insert into T_admin_UserRole(cUserNo,cRoleNo) values (@temp,@roleID)
if @@error<>0 --表示有错
begin
rollback tran
set @return=0
end
else
begin
commit tran
set @return=1
end
select @return
end