ALTER  proc [dbo].[RoleUser](@RoleID varchar(20),@UserID varchar(20))
as
declare  @count int
set @count=(select  count(PTU_Sub) from PT_Role where PTR_ID=@RoleID)
declare  @Sub varchar(200)
set @Sub=(select  PTU_Sub from PT_Role where PTR_ID=@RoleID)
declare @newSub varchar(200)
set @newSub=(@Sub+','+@UserID)
begin
if(@count=0)
begin
update  PT_Role  set PTU_Sub=@UserID where PTR_ID=@RoleID
end
if(@count<>0)
begin
update  PT_Role  set PTU_Sub=@newSub where PTR_ID=@RoleID
end

end

相关文章:

  • 2021-07-05
  • 2021-10-31
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2021-12-14
  • 2022-12-23
  • 2021-09-24
相关资源
相似解决方案