ALTER procedure [dbo].[P_OA_News_delete]
@NewsID uniqueidentifier, --新闻ID
@UserID uniqueidentifier --用户ID
as
begin transaction
declare @count int
set @count=0;
select @count=count(*) from OA_Admin where AdminID=@UserID
if(@count=0) --用户没权限
begin
end
else
begin
delete from OA_News where NewsID=@NewsID
end
通过传进来的UserID在我管理员的表中能不能查到 查不到就不能删除 查得到就能删除 我这逻辑对么 对的号 还差什么代码 错的话 要怎么设计