DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

17
kicks
published 1 year, 3 months ago, submitted by ejstembler 1 year, 3 months ago

ejstembler.com — A set of naming convention standards when starting a new SQL Server database.

Add a comment 7 comments | category: | Views: 102 | Get KickIt image code
tags: , | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
Minus 1 kick.

"Blog" has no comments feature nor an RSS or Atom feed.

I agree with most content of the article except for:

1. Keyword Casing - SMSS may code color keywords but we don't always get to work with queries in an editor with coloring. Upper case doesn't hurt.

2. Excess white space - If you are familiar with column-selection (Shift+Alt+drag in SMSS and VS2005) you'll find aligning field names and types and assignments very useful.

3. FieldName and Parameter casing - most forms are good if they are consistent, I go with FxCop casing rules because most field names in SQL end up as objects and properties in .NET.
posted by jstangroome jstangroome 1 year, 3 months ago
Yeah, I'll add comments and feeds eventually. I'm writing the blog engine from scratch in my sparse free time. Just finished the tag cloud functionality...
posted by ejstembler 1 year, 3 months ago
I agree. It is not a blog without a feed or comments.

I am not sure how I feel about the uppercase keywords. I do not like holding down shift all that often but it does make the scripts look more readable. It does make sense when a script is viewed outside of SMSS where it is not color-coded. But I use Notepad2 which does color-code known files like SQL scripts. But in a book that is in black and white I would prefer the uppercase keywords.

As for prefixing, I like to prefix common objects. The ASP.NET Membership provider creates a set of tables and stored procedures which are all prefixed with aspnet. I like that because I know they are a part of that system. For the applications I build I do the same so that a single database can stay organized with many groups of objects without a potential conflict. A set of schemas could also be used, but I think that over-complicates matters because that pulls in additional requirements for permissions. I try to only use schemas when I intend to limit access to a set of objects.
posted by offwhite offwhite 1 year, 3 months ago
Yes, it's too bad Microsoft used that naming convention for the ASP.net membership objects. With SQL Server 2005 they could have just used an schema instead. For instance, instead of dbo.aspnet_Users, they should have used ASPNet.Users.

Check out Microsoft's AdventureWorks sample database for an example of how to correctly name tables using schemas. You'll notice that they use several schemas: HumarResources, Person, Production, Purchasing, and Sales.
posted by ejstembler 1 year, 3 months ago
Maybe I'm missing something here but I find the aspnet_ prefixes very useful.
I don't know what projects you guys work on but with web hosting you usually get one database and with prefixes you can easilly recognize your tables from the aspnet ones.
posted by pohodovka 1 year, 3 months ago
Not a bad article but like other readers, I can't agree with the items on casing or whitespace. There is an assumption here that colour coding will always be available (and that the user is not colour-blind enough to lose the distinctions). There is no harm in using upper case or additional whitespace (indeed, there is often a positive benefit) so there is no reason not to use it.
posted by BlackWasp 1 year, 3 months ago
I thought you could supply your own custom prefix when the database was built. Maybe I'm thinking of something else.
posted by senfo 1 year, 3 months ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge