|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Standard naming convention for index and triggers?and keys? I've seen indexes as: Table name + Column name(s) + Unique/Non-uniqueness + Clustered/Non-clustered OrderDetails_OrderIDOrderDetailID_U_Cidx This is fine if it is only one column, but what if their are multiple columns (3 or more). This would make the name pretty large. Also, I am not a fan of underscores in a name (but I do use them in some cases). Triggers: titles_instrg titles_updtrg titles_deltrg Keys I have seen as: pk_Customers_CustomerID fk_OrdersCustomerID_CustomersCustomerID None of the books I have looked at really talk about it. I found these on a web page for naming conventions. But this is just one opinion. Thanks, Tom On Fri, 28 Jul 2006 15:28:00 -0700, "tshad"
<tscheider***@ftsolutions.com> wrote: >Is there a standard naming convention (best practice) for indexes, triggers I don't spend much time looking at indexes by name. I just use>and keys? > >I've seen indexes as: > >Table name + Column name(s) + Unique/Non-uniqueness + >Clustered/Non-clustered > > OrderDetails_OrderIDOrderDetailID_U_Cidx > >This is fine if it is only one column, but what if their are multiple >columns (3 or more). This would make the name pretty large. TableName_columns, but I am willing to abbreviate and otherwise compromise the columns part. I do want indication of clustered or unique, as I want to get that information from a difninitive source, not assume a name is correct. >Also, I am not a fan of underscores in a name (but I do use them in some I don't much care for them, but that means that when I DO use them it>cases). is a significant break point, as in table name vs index columns >Triggers: I juse use TableName_IUD, with whatever subset of IUD (Insert, Update,> >titles_instrg >titles_updtrg >titles_deltrg Delete) fits that particular trigger. If I ever end up with multiple triggers I will just add whatever suffix seems natural. >Keys I have seen as: In violation of all the Right Thinking and Acting folks here, I just> > pk_Customers_CustomerID > fk_OrdersCustomerID_CustomersCustomerID let the system give them names. >None of the books I have looked at really talk about it. I found these on a And mine is just one more opinion.>web page for naming conventions. But this is just one opinion. Roy Harvey Beacon Falls, CT |
|||||||||||||||||||||||