如何在 SQL Server 中使表只读? [英] How to make a table Read Only in SQL Server?
本文介绍了如何在 SQL Server 中使表只读?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在更新该表中的一些记录集,之后我需要将该表设为只读.
I am updating some set of records in that table, after that I need to make this table read only.
那么如何在 SQL Server 中使表只读?
So how to make a table Read Only in SQL Server?
推荐答案
- 触发回滚传输
- 只读文件组
- 不要授予插入/更新/删除权限
第 3 条可能是最佳实践.例如,如果您的连接是 db_owner,那么触发器可以禁用触发器或无论如何将表移动到不同的文件组.
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.
这篇关于如何在 SQL Server 中使表只读?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文