Home > Archive > MS SQL Server > March 2006 > Enforcing naming conventions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Enforcing naming conventions
Tim Greenwood

2006-03-14, 8:23 pm

We're trying to enforce some coding practices here and were taking the
sledgehammer approach of putting a trigger on the sysobjects table that
would raise an error when invalid names were submitted.

Why is "sa" not allowed to add a trigger to that table ?

What other methods are the recommended way to enforce something like this?

Thanks !!


Sue Hoegemeier

2006-03-15, 3:23 am

You can't add triggers to system tables. You can find some
hacks to get around it but it's not recommended and
generally pointless anyway. The triggers won't fire the way
you think they would -often times they won't fire due to
different mechanisms used by SQL Server when it updates
information in system tables.
On SQL Server 2005, you can use DDL triggers.
Otherwise, you can look at auditing tools - third party or
profiler, server side traces.

-Sue

On Tue, 14 Mar 2006 15:51:27 -0800, "Tim Greenwood"
<tim_greenwood A-T yahoo D-O-T com> wrote:

>We're trying to enforce some coding practices here and were taking the
>sledgehammer approach of putting a trigger on the sysobjects table that
>would raise an error when invalid names were submitted.
>
>Why is "sa" not allowed to add a trigger to that table ?
>
>What other methods are the recommended way to enforce something like this?
>
>Thanks !!
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com