[Quote=引用楼主 over2012 的回复:]
在C#(web)中每次最高权限用户每添加一次用户的时候,我就想判断它有没有超过50个用户,如果超过了即不能添加以提示框弹出。是写存储过程还是触发器。像用select count(*) as 记录数 from tb ,怎么返回它的记录数。谢谢 我是菜鸟!
[/Quote]
create trigger my_trig on tb for insert
as
begin
declare @cnt as int
select @cnt = count(1) from tb where 关键字 = (select 关键字 from inserted)
if @cnt > 50
...
else
...
end