Aug 19, 2006 #1 Luzian Programmer Nov 27, 2005 103 US I need a trigger to prevent deletion of any rows on all tables except for those I specify.
Aug 20, 2006 1 #2 mrdenny Programmer May 27, 2002 11,595 Put a column in your table that is called ReadOnly or something to that effect. Make is a bit data type. If it's not deleteable set ReadOnly to 1. Have a trigger on the table setup that checks the max value of the ReadOnly field in the deleted column. If the value is 1 issue a rollback command. Denny MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005) --Anything is possible. All it takes is a little research. (Me) http://www.mrdenny.com Upvote 0 Downvote
Put a column in your table that is called ReadOnly or something to that effect. Make is a bit data type. If it's not deleteable set ReadOnly to 1. Have a trigger on the table setup that checks the max value of the ReadOnly field in the deleted column. If the value is 1 issue a rollback command. Denny MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005) --Anything is possible. All it takes is a little research. (Me) http://www.mrdenny.com