Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««123»»

Worst Practice - Spaces in Object Names Expand / Collapse
Author
Message
Posted Wednesday, October 1, 2003 12:55 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, February 8, 2008 9:01 AM
Points: 2, Visits: 2
I agree. We should "never" put spaces in object names, whether those objects are tables or fields.

One reason is this 'Object Name' (one space) and 'Object Name' (two spaces) are two unique objects - try to tell them apart in a code listing!

However, it's easy to tell the difference between 'ObjectName' and 'Object_Name'.




Post #81271
Posted Wednesday, October 1, 2003 3:31 PM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, October 20, 2014 12:09 PM
Points: 91, Visits: 198
>>I blame the practice on Access database users.<<
Poor, maligned Access users!

I came to SQL Server via Access, but I *never* used spaces in names.

On the other hand, I've inherited more than one SQL Server database that never existed other than in SQL Server but where the developer used spaces and all kinds of other no-no's.

In Access, I always use "camel-case", e.g., UniqueNameForTable, and continue this practice in SQL Server. My pinkie hates jumping to the underscore character, so whenever I have a say in things, I don't use underscores in any object names.

My own biased opinion... I think using underscores to break up a name is a bad habit left over from older systems that don't preserve case, such as the "O" word...

Best regards,
SteveR






Post #81272
Posted Wednesday, October 1, 2003 4:39 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 11:10 AM
Points: 31,279, Visits: 15,738
Isn't camelcase uniqueNameForObject?

In any case, I completely agree. Spaces are a pain!!!! especially when scripting.

I'd expand this to include stupid folder names as well (#$%#^#$%$# Program Files folder)

Steve Jones
sjones@sqlservercentral.com
http://www.sqlservercentral.com/columnists/sjones
The Best of SQL Server Central.com 2002 - http://www.sqlservercentral.com/bestof/
www.dkranch.net







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #81273
Posted Wednesday, October 1, 2003 4:44 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, February 3, 2005 3:17 PM
Points: 504, Visits: 1
As usual Andy, you have done a wonderful job writing your article! One of the first things I did when I got hired here was to create a SQL Best Practices document to help the people here to write better SQL. This is one of the topics I covered. Kudo's, and keep them coming :)

Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer





Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer

This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.
Post #81274
Posted Wednesday, October 1, 2003 5:35 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, November 16, 2014 6:41 PM
Points: 2,693, Visits: 1,219
quote:

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.



Don't blame the Access database users themselves. Have you ever produced a database using the Access Database wizard and not had spaces in object names??

If blame is to be laid anywhere it should be with the producers of the product that not only allows it, but provides tools that direct you towards developing that way.


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 #81275
Posted Wednesday, October 1, 2003 5:55 PM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: Moderators
Last Login: Monday, November 17, 2014 2:20 PM
Points: 6,800, Visits: 1,914
Gary, thanks for the kind words. Any chance you could genericify that best practices document and submit as an article (or two)?

Andy
http://www.sqlservercentral.com/columnists/awarren/




Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Post #81276
Posted Wednesday, October 1, 2003 6:08 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, February 3, 2005 3:17 PM
Points: 504, Visits: 1
Andy,

At this point I just don't have time to get the legal stuff I would need to have done to do that. Plus I believe there is already one on the Technet CD. I'll have to check on that. I'm just a developer who also has to do DBA duties. I actually have nothing to do with the SQL Server team.

Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer





Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer

This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.
Post #81277
Posted Thursday, October 2, 2003 1:26 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 11:48 AM
Points: 2,914, Visits: 1,845
I think the problem with Access is that it is an end-user database and as such has to be as simple and as forgiving as possible.

This is fine, but how many programmers start off with Access then migrate their skills to SQL Server?

Chances are that you pick up skills on the job and therefore the poor old Access developer learns about the pitfalls as he plummets into the hole grabbing handfuls of air as he falls.

I have a bee in my bonnet over the lack of training that companies put their employees through and the "make-do-and-mend" culture when it comes to tools.

After 5 days each on the original MS SQL 6.5 courses my productivity went through the roof and this obviously had massive benefits for my then employer.

I know that for small employers training costs are an issue but
  • They gain on employee productivity.
  • Their systems will be better built and thus more easily maintained.
  • If they can't afford training then they can contribute to it and/or give employees paid leave specifically for training.






LinkedIn Profile
Newbie on www.simple-talk.com
Post #81278
Posted Thursday, October 2, 2003 4:34 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: Moderators
Last Login: Monday, November 17, 2014 2:20 PM
Points: 6,800, Visits: 1,914
I figured it was of your own making, that's why it was interesting. If there is one on Technet, a link would be handy. We're hoping to have the topic covered in more detail soon, as one or more articles.

Andy
http://www.sqlservercentral.com/columnists/awarren/




Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Post #81279
Posted Friday, October 1, 2004 6:53 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, November 10, 2014 7:17 AM
Points: 295, Visits: 284

 Wow! Hot topic... I don't know what the big deal is though. I like spaces in table names, column names, wherever...

  JUST KIDDING!!! 

I think a "best practices" option should be added to YUKON so default naming conventions can be enforced. For example, pattern match object names.

 No! Please don't ask for more Yukon features!! We have waited long enough already!!!

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.

That would explain that horrible SQL Server sample database NorthWind... AARGH!!

Aaaah... fun with formatting and smileys. Can you tell it's Friday?!



Bryant E. Byrd, BSSE MCDBA MCAD
Business Intelligence Administrator
MSBI Administration Blog
Post #139578
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse