I am trying to find out if there are mechanisms that will allow for data to only be inserted into tables and not deleted or updated in SQL Server?
Any help would be great, doing research at the moment and have become stuck.
I am trying to find out if there are mechanisms that will allow for data to only be inserted into tables and not deleted or updated in SQL Server?
Any help would be great, doing research at the moment and have become stuck.
You can grant and revoke privileges in the tables:
# only permission for insert and select
GRANT SELECT, INSERT ON employees TO public;
# or revoke other permissions
REVOKE UPDATE,DELETE ON mytable FROM public;
You can control permissions for user(s)/public
Presumably, you mean insertions and selects.
If so, you can create instead of
triggers on the table for deletes and updates. These triggers would simply return errors or warnings and not change the table.
I personally wouldn't create trigger on each table to prevent INSERT and just disallow UPDATE and DELETE rights for all users.