Home > SQL and .NET Blog > Protecting tables, Procedures and … in SQL Server 2008

Protecting tables, Procedures and … in SQL Server 2008

 

Here is the trigger which protects all the tables and procedures in a database / server.

create trigger triggername
on all server
for create_procedure,alter_procedure,drop_table
as 
    Print 'you are attempting to drop the table or create procedure or drop procedure'
    rollback;

This trigger can also be extended to protect all the verticals like Index, Functions, Views, etc

-Yuva

Categories: SQL and .NET Blog
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: