May 8, 2009 at 1:29 pm
There is a table that needs to be manipulated but it requires controls to prevent the inclusion of new rows and eliminate them.
Is it possible to do this with triggers in T_SQL?
Thanks....
May 8, 2009 at 2:53 pm
Yes, but normally you would do this through Permissions setings on the table: I.E:, just Deny INSERT access to the table.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 8, 2009 at 3:00 pm
Excellent, but this permissions must be set on the table or users?
May 8, 2009 at 3:50 pm
Technically, all permissions are set ON objects, and TO principals (users, roles, etc.).
The SQL for this would be something like this:
DENY INSERT ON OBJECT::[schema].[YourTable] TO Public
Assuming I have that correct, this will deny everyone (even the DBO, I think) the ability to INSERT. You will have to REVOKE this DENY if you ever do actually need to Insert.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply