且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 SQL Server 中使表只读?

更新时间:2023-01-29 13:36:56

  1. 触发回滚传输
  2. 只读文件组
  3. 不要授予插入/更新/删除权限

第 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.