• DaVinci007 - you're absolutely right, it is quite easy to get around this trigger. I suppose my point was really that this approach would supplement more powerful security measures (like setting up role-based access) rather than provide an end-to-end solution. Thanks for the heads up on the SQL Server defect with triggers - this is new to me, so made interesting reading.

    Marcia - thank you for the kind comments! Everyone makes mistakes (who hasn't killed a server in their time?). The likelihood of repeating a mistake, I think, is inversely proportional to the severity of the mistake that was made (the obvious extreme of this of course is getting fired!)

    ---

    Note to developers:
    CAST(SUBSTRING(CAST(FLOOR(NULLIF(ISNULL(COALESCE(1,NULL),NULL),NULL)) AS CHAR(1)),1,1) AS INT) == 1
    So why complicate your code AND MAKE MY JOB HARDER??!:crazy:

    Want to get the best help? Click here https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help (Jeff Moden)
    My blog: http://uksqldba.blogspot.com
    Visit http://www.DerekColley.co.uk to find out more about me.