![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||||||
| ||||||||
|
|
I am currently doing a review of my personal database naming conventions and found that there are not much (good) examples in the literature for some special objects. |
|
Certainly there are bigger issues in a database project that that, but I would like to try cleaning that up. |
|
I am using SQL Server 2005 what requires that constraint names are unique in the whole database, index names to be unique on table level at least. I do NOT wish to use any prefixes or suffixes such as PK, |
|
1) Triggers .. <verb><object>_<table name>. |
|
2) Check constraints: I use <explanation>_<table name> (e. g. PreventSingleNodes_Relations or ValidateRelationType_Relations) |
|
3) Default constraints, Unique constraints .. Better ideas here? |
|
5) Primary key constraints, Foreign key constraints .. I tend not to put a constraint on them at all. Their nature does not |
|
7) Indexes: As SQL Server does not require unique index names in the whole database but just in the table, |
#3
| ||||||||
| ||||||||
|
|
I am currently doing a review of my personal database naming conventions and found that there are not much (good) examples in the literature for some special objects. |
|
Certainly there are bigger issues in a database project that that, but I would like to try cleaning that up. |
|
I am using SQL Server 2005 what requires that constraint names are unique in the whole database, index names to be unique on table level at least. I do NOT wish to use any prefixes or suffixes such as PK, |
|
1) Triggers .. <verb><object>_<table name>. |
|
2) Check constraints: I use <explanation>_<table name> (e. g. PreventSingleNodes_Relations or ValidateRelationType_Relations) |
|
3) Default constraints, Unique constraints .. Better ideas here? |
|
5) Primary key constraints, Foreign key constraints .. I tend not to put a constraint on them at all. Their nature does not |
|
7) Indexes: As SQL Server does not require unique index names in the whole database but just in the table, |
#4
| ||||||||
| ||||||||
|
|
I am currently doing a review of my personal database naming conventions and found that there are not much (good) examples in the literature for some special objects. |
|
Certainly there are bigger issues in a database project that that, but I would like to try cleaning that up. |
|
I am using SQL Server 2005 what requires that constraint names are unique in the whole database, index names to be unique on table level at least. I do NOT wish to use any prefixes or suffixes such as PK, |
|
1) Triggers .. <verb><object>_<table name>. |
|
2) Check constraints: I use <explanation>_<table name> (e. g. PreventSingleNodes_Relations or ValidateRelationType_Relations) |
|
3) Default constraints, Unique constraints .. Better ideas here? |
|
5) Primary key constraints, Foreign key constraints .. I tend not to put a constraint on them at all. Their nature does not |
|
7) Indexes: As SQL Server does not require unique index names in the whole database but just in the table, |
#5
| |||
| |||
|
|
I am currently doing a review of my personal database naming conventions and found that there are not much (good) examples in the literature for some special objects. Have you looked at the ISO-11179 Standards? I happen to have a book on this topic, SQL PROGRAMMING STYLE, based on the Standards and few decades of research in code readability. |
|
5) Primary key constraints, Foreign key constraints .. I tend not to put a constraint on them at all. Their nature does not change much so I don't need to reference them. |
|
If there is an error, then the message includes that they are PK or FK, so the constraint name adds no information. |
#6
| |||
| |||
|
|
I am currently doing a review of my personal database naming conventions and found that there are not much (good) examples in the literature for some special objects. Have you looked at the ISO-11179 Standards? I happen to have a book on this topic, SQL PROGRAMMING STYLE, based on the Standards and few decades of research in code readability. |
|
5) Primary key constraints, Foreign key constraints .. I tend not to put a constraint on them at all. Their nature does not change much so I don't need to reference them. |
|
If there is an error, then the message includes that they are PK or FK, so the constraint name adds no information. |
#7
| |||
| |||
|
|
I am currently doing a review of my personal database naming conventions and found that there are not much (good) examples in the literature for some special objects. Have you looked at the ISO-11179 Standards? I happen to have a book on this topic, SQL PROGRAMMING STYLE, based on the Standards and few decades of research in code readability. |
|
5) Primary key constraints, Foreign key constraints .. I tend not to put a constraint on them at all. Their nature does not change much so I don't need to reference them. |
|
If there is an error, then the message includes that they are PK or FK, so the constraint name adds no information. |
#8
| |||
| |||
|
|
Aren't you assuming that all DBMS vendors will provide adequate PK/FK info (without the constraint name) when an error occurs? |
|
There could be multiple FK columns on a table which reference the same PK table (e.g., a PK table of valid states or countries). |
#9
| |||
| |||
|
|
Aren't you assuming that all DBMS vendors will provide adequate PK/FK info (without the constraint name) when an error occurs? |
|
There could be multiple FK columns on a table which reference the same PK table (e.g., a PK table of valid states or countries). |
#10
| |||
| |||
|
|
Aren't you assuming that all DBMS vendors will provide adequate PK/FK info (without the constraint name) when an error occurs? |
|
There could be multiple FK columns on a table which reference the same PK table (e.g., a PK table of valid states or countries). |
![]() |
| Thread Tools | |
| Display Modes | |
| |