Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 How to write a trigger restict delete or update

Author  Topic 

QuachNguyen
Starting Member

15 Posts

Posted - 2007-11-17 : 14:30:49
hi All

I have an administrator account in my users table, I want to restrict user delete or update (modify) this account, how can I write a trigger to do that ?

Here is missing my statement :


CREATE TRIGGER UnModify_Admin_Account
ON Users
AFTER DELETE,UPDATE
AS
BEGIN
SET NOCOUNT ON;
// if username is 'Administrator' RAISERROR and return @@ERROR
END
GO


Many Thanks in advance !

Regards,
QuachNguyen
   

- Advertisement -