trigger to prevent the update of a particular column

Ddd
Posted by Ddd under Sql Server category on | Points: 40 | Views : 5165
emp table has 3 columns known as eno, empname,salary.
This trigger will prevent the update of the empname column


create trigger trg on emp for update
as
if update(empname)
begin
print 'not allowed'
rollback transaction
end

Comments or Responses

Login to post response