Hi just wondering if there is a way to have one record in a table be read
only, were an application can not remove it and have all other records act
normally? I am currently handling this in .net code but would prefer to
have it built into the table.
thanks.

Signature
Paul G
Software engineer.
Jens Süßmeyer - 27 Apr 2005 16:16 GMT
No there is now row level security based on SQL Server 2000.
HTH, Jens Suessmeyer.
---
http://www.sqlserver2005.de
---
> Hi just wondering if there is a way to have one record in a table be read
> only, were an application can not remove it and have all other records act
> normally? I am currently handling this in .net code but would prefer to
> have it built into the table.
> thanks.
Jens Süßmeyer - 27 Apr 2005 16:25 GMT
Sorry, i mean : No there is no row level security based on SQL Server 2000.
> No there is now row level security based on SQL Server 2000.
>
[quoted text clipped - 10 lines]
>> have it built into the table.
>> thanks.
Paul - 27 Apr 2005 16:28 GMT
ok thanks for the information.
> No there is now row level security based on SQL Server 2000.
>
[quoted text clipped - 9 lines]
> > have it built into the table.
> > thanks.
Hugo Kornelis - 27 Apr 2005 22:55 GMT
>Hi just wondering if there is a way to have one record in a table be read
>only, were an application can not remove it and have all other records act
>normally? I am currently handling this in .net code but would prefer to
>have it built into the table.
>thanks.
Hi Paul,
You can use a trigger:
CREATE TRIGGER DontTouchThisRow
ON MyTable AFTER UPDATE, DELETE
AS
IF EXISTS (SELECT *
FROM deleted
WHERE KeyCol = 1) -- Column to be protected
BEGIN
RAISERROR ('Row 1 may not be changed or removed', 16, 1)
ROLLBACK TRANSACTION
END
go
Best, Hugo

Signature
(Remove _NO_ and _SPAM_ to get my e-mail address)