Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss Content Posted by Andy Warren
»
Worst Practice - Spaces in Object Names
25 posts, Page 1 of 3
1
2
3
»
»»
Worst Practice - Spaces in Object Names
Rate Topic
Display Mode
Topic Options
Author
Message
Andy Warren
Andy Warren
Posted Sunday, September 28, 2003 12:00 AM
SSCertifiable
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
Comments posted to this topic are about the content posted at
http://www.sqlservercentral.com/columnists/awarren/worstpracticespacesinobjectnames.asp
>
http://www.sqlservercentral.com/columnists/awarren/worstpracticespacesinobjectnames.asp
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #16742
scaleovenstove
scaleovenstove
Posted Tuesday, September 30, 2003 7:31 PM
Forum Newbie
Group: General Forum Members
Last Login: Monday, August 13, 2012 2:37 PM
Points: 2,
Visits: 67
also, not only table naming conventions, but field naming conventions. it is really tough to write queries that join two tables where they both have fields named "id" to join on. It gets even worse when you add more fields, joins, etc. True, you can alias columns and tables (a.id = b.id), but that is a pain and is avoidable by naming the fields the "right" way!
Post #81262
philcart
philcart
Posted Tuesday, September 30, 2003 9:00 PM
SSCrazy
Group: General Forum Members
Last Login: Friday, May 17, 2013 5:53 AM
Points: 2,692,
Visits: 1,074
add to this, avoiding the use of non-alphanumeric characters, wildcards, etc...
eg: tblName%
Arrrgghh!!!!
Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface
Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface
Australian SQL Server User Groups
-
My profile
Phills Philosophies
Murrumbeena Cricket Club
Post #81263
David.Poole
David.Poole
Posted Wednesday, October 01, 2003 1:46 AM
SSCrazy
Group: General Forum Members
Last Login: Yesterday @ 9:35 AM
Points: 2,749,
Visits: 1,407
I agree with this 100%
Don't use spaces in table names
Stick to alphanumerics, (preferably without the numerics unless you absolutely must)
Don't use reserved words for tables i.e have a table called "Order" or "Exists"!
I think a "best practices" option should be added to YUKON so default naming conventions can be enforced. For example, pattern match object names.
LinkedIn Profile
Post #81264
steveshellard
steveshellard
Posted Wednesday, October 01, 2003 2:42 AM
Grasshopper
Group: General Forum Members
Last Login: Thursday, October 23, 2008 7:24 AM
Points: 15,
Visits: 2
I guess people do it for readability, but I've always used the '_' (underscore) if I've needed to put a gap between words in a table name.
eg. New_Table_Name
Post #81265
Jonr
Jonr
Posted Wednesday, October 01, 2003 3:22 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Tuesday, March 13, 2012 9:34 AM
Points: 141,
Visits: 61
Totally agree - bad enough that data types can't be standardised across databases/programming languages, let alone adding nonsense like spaces and underscores to object names. Added to which, doesn't it contravene ANSI standard SQL, which would make it more difficult to port?
Jon Reade
Edited by - jonreade on 10/01/2003 03:52:31 AM
Jon
Post #81266
Andy Warren
Andy Warren
Posted Wednesday, October 01, 2003 4:46 AM
SSCertifiable
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
I'm going to a follow up to hit on the object naming thing a little harder - you guys are right, spaces arent the only bad thing. Just particularly objectionalble to me!
Andy
http://www.sqlservercentral.com/columnists/awarren/
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #81267
Lara Rubbelke
Lara Rubbelke
Posted Wednesday, October 01, 2003 6:43 AM
SSC-Addicted
Group: General Forum Members
Last Login: Monday, May 16, 2011 1:14 PM
Points: 440,
Visits: 66
Thank you! I have been fighting this battle for years! Nothing is as frustrating as writing out the query, or grabbing columns from the object browser, hitting execute and getting an error because I need brackets around some object. Egad! Just don't do it! Embrace the non-spaced object naming convention!
There are indeed many "worst practices" to avoid, but this is so easy to avoid.
Post #81268
Robert W Marda
Robert W Marda
Posted Wednesday, October 01, 2003 12:15 PM
SSC Eights!
Group: General Forum Members
Last Login: Friday, February 15, 2013 10:33 AM
Points: 976,
Visits: 48
I see no reason to use spaces for object names or column names. To me TableName is just as easy to read as Table Name and then I don't have to see those brackets which just cluter up the screen.
Robert W. Marda
SQL Programmer
bigdough.com
The world’s leading capital markets contact database and software platform.
Robert W. Marda
SQL Programmer
Ipreo
Post #81269
John Langston
John Langston
Posted Wednesday, October 01, 2003 12:54 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Thursday, May 16, 2013 9:03 AM
Points: 175,
Visits: 324
I blame the practice on Access database users. Access allows this practice and then if the Access database has to be moved to SQL Server, those tasked with the move get bitten.
Post #81270
« Prev Topic
|
Next Topic »
25 posts, Page 1 of 3
1
2
3
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.