SQL Server Magazine Forums

Spacer
< REFRESH >
Topic Title: User Name Best Practices
Topic Summary:
Created On: 06/09/2009 07:26 AM

View topic in raw text format.
 06/09/2009 07:26 AM
 User is offline  Print this message

Author Icon
tombloom

Posts: 1
Joined: 06/09/2009

Hi.

Looking for some best practices for user/login names for SQL Server 2005, such as avoiding spaces or dashes (found that either of these creates the need for quotations around the name). Underscores are fine. Any other thoughts? We are migrating from 2000 to 2005 and want to clean up the user names we are currently stuck with.

Thanks,

John
    Reply     Quote     Top     Bottom    
 06/09/2009 06:13 PM
 User is offline  View Users Profile  Print this message

Author Icon
gunneyk

Posts: 1128
Joined: 07/27/2007

Yes the best advice that I know of is to stay away from spaces, dashes and reserved words.

-------------------------
Andrew J. Kelly
    Reply     Quote     Top     Bottom    
 10/07/2009 08:08 AM
 User is offline  Print this message

Author Icon
SQLUSA

Posts: 2859
Joined: 05/17/2005

Use Pascal Casing ( or Hungarian Naming after Charles Simonyi) like:

SalesOrderHeader, SalesOrderDetail, Product, ProductPhoto, ProductDocument

If you inherit a table with spaces in name, you will be married to [table name] (square brackets) for ever!

Underscore (_) still around in some system table names, kind of old-fashioned.


Kalman Toth, SQL Server 2008 Training
http://www.sqlusa.com
    Reply     Quote     Top     Bottom    
View topic in raw text format.
< REFRESH >

FuseTalk Enterprise Edition - © 1999-2009 FuseTalk Inc. All rights reserved.