开发者

How to deny Delete for a single Row in a Table

I use SQL Server 2008.

I need to DENY any delete operations on a specific ROW in a Table.

I would like to know how can implement this feature at DB level.

Please provide a sample of T-SQL. 开发者_开发知识库Thanks for your time.


Create a trigger that throws an exception if the deleted row is your specific row.


Use INSTEAD OF DELETE trigger and ROLLBACK TRAN. Here is a good article on this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜