Re: Record level security?
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 23 Jan 2008 14:38:22 -0800
zz12 (IDontLikeSpam@xxxxxxxxxxx) writes:
I tried creating only 1 trigger that lists "FOR INSERT, UPDATE, DELETE"
but it didn't seem to fully work in keeping the data totally frozen.
But I think I have this working now in that I ended up creating 2
triggers on the targeted frozen historic table. I created one that
lists:
"FOR INSERT, UPDATE" and using the "FROM inserted i" as the alias
and then another one that lists
"FOR UPDATE, DELETE" and using the "FROM deleted d" as the alias.
I guess that if it works, it works.
I interpreted your question that you did not want existing rows to
be deleted or changed. But it seems logical that you also want to
avoid new rows to be added, or existing rows to be moved into the
frozen period.
I'm not sure if this is the normal way of doing it but I'm really glad
it's working.
I would probably do it in one trigger, but I grow up in a cruel world
where you could only have one trigger per action on a table, so I had to
learn how to do it. :-)
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Record level security?
- From: zz12
- Re: Record level security?
- From: Erland Sommarskog
- Re: Record level security?
- From: zz12
- Re: Record level security?
- From: Erland Sommarskog
- Re: Record level security?
- From: zz12
- Re: Record level security?
- From: Erland Sommarskog
- Re: Record level security?
- From: zz12
- Record level security?
- Prev by Date: RE: Integrated Security in the DMZ
- Next by Date: RE: Urgent problem about SQL Server
- Previous by thread: Re: Record level security?
- Next by thread: SQL 2005: non SA user create a job
- Index(es):
Relevant Pages
|