[求助]触发器!
create trigger sysuser_trig
on sysuser
for insert
as
begin
declare
@errno int,
@errmsg varchar(255)
if exists(select * from sysuser,inserted where inserted.username = sysuser.username)
begin
select @errno=30008,
@errmsg='该用户名已存在'
raiserror @errno @errmsg
rollback transaction
end
end
go
问题是,无论有没有那条数据,都出现 '该用户名已存在'
不理解!!