question

Rob Allen avatar image
Rob Allen asked

Prevent INSERT statements on depreciated table

I have a table of historical data that has been replaced by a revised data model. Is there a way to lock out all new insert statements on that table at the table level to make sure everyone moves over to the new model?

sql-server-2005insert
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
TG avatar image
TG answered

Some possibilities include:

DENY access because I'm sure you users are not connecting as admins :)

Rename the (old) table to insure that existing application code has made the switch.

Create a trigger instead of insert,update,delete which does nothing but raiserror.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.