How to make a table Read Only in SQL Server?

前端 未结 3 1125
天涯浪人
天涯浪人 2020-12-08 08:02

I am updating some set of records in that table, after that I need to make this table read only.

So how to make a table Read Only in SQL Server?

3条回答
  •  情书的邮戳
    2020-12-08 08:27

    1. Trigger with rollback trans
    2. Read only filegroup
    3. Don't grant insert/update/delete permissions

    Number 3 is probably best practice. For example, if your connection is db_owner for example then the trigger can be disabled the trigger or move the table to a different filegroup anyway.

提交回复
热议问题