Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Databases General > Re: Naming conv...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 17 Topic 3149 of 3295
Post > Topic >>

Re: Naming conventions for special database objects

by Philipp Post <Post.Philipp@[EMAIL PROTECTED] > Apr 29, 2008 at 05:01 AM

First thanks for your input Joe and Carl.

> Obviously you meant "I tend not to put a constraint name on them at
all."<

Unfortunately SQL Server lets you no choice - you get a name for
primary key and foreign key constraints and all others I mentioned.
The following are created by default by the system if you do not
choose one yourself:

Primary Keys: PK_<table name>
Foreign Keys: FK_<referencing table name>_<referenced table name>
Default Constraints: DF_<table name>_<column name>
Check Constraints: CK_<something user defined>
Unique Constraints: UQ_<table name>_<column names> (or some random
ugly string with numbers and underscores)
Indexes: get the same name as column name or as the primary key name

ISO-11179 is obviously a bit general to answer each and every naming
question. And yes, I know "SQL programming style" what was the most
complete compilation of information on this topic I found. Page 11
criticises the PK_, FK_ affixes, but unfortunately gives no
alternative. FK is the role the foreign key plays in that table, but
not in the other, so this is not a good option. On indexes it says
that _idx suffix is acceptable (p. 18), on check constraints it has a
lot of good information.

As I do not like prefixes either, the idea was to see if there are
some better ways to do.

brgds

Philipp Post
 




 17 Posts in Topic:
Naming conventions for special database objects
Philipp Post <Post.Phi  2008-04-27 13:13:06 
Re: Naming conventions for special database objects
--CELKO-- <jcelko212@[  2008-04-28 07:28:09 
Re: Naming conventions for special database objects
"Carl Kayser" &  2008-04-28 11:12:23 
Re: Naming conventions for special database objects
--CELKO-- <jcelko212@[  2008-04-28 13:00:10 
Re: Naming conventions for special database objects
Philipp Post <Post.Phi  2008-04-29 05:01:58 
Re: Naming conventions for special database objects
Marco Mariani <marco@[  2008-04-29 14:27:31 
Re: Naming conventions for special database objects
Philipp Post <Post.Phi  2008-04-29 06:09:15 
Re: Naming conventions for special database objects
Marco Mariani <marco@[  2008-04-29 16:11:07 
Re: Naming conventions for special database objects
--CELKO-- <jcelko212@[  2008-04-29 08:22:47 
Re: Naming conventions for special database objects
--CELKO-- <jcelko212@[  2008-04-29 08:41:10 
Re: Naming conventions for special database objects
Marco Mariani <marco@[  2008-04-30 11:13:44 
Re: Naming conventions for special database objects
Philipp Post <Post.Phi  2008-04-29 11:08:57 
Re: Naming conventions for special database objects
Marco Mariani <marco@[  2008-04-30 11:15:33 
Re: Naming conventions for special database objects
Philipp Post <Post.Phi  2008-04-29 11:16:55 
Re: Naming conventions for special database objects
--CELKO-- <jcelko212@[  2008-04-29 14:42:25 
Re: Naming conventions for special database objects
--CELKO-- <jcelko212@[  2008-04-30 08:38:46 
Re: Naming conventions for special database objects
Marco Mariani <marco@[  2008-04-30 18:39:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 9:26:02 CST 2008.