<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Database Coding Standards and Guidelines &#8211; Part 1</title>
	<atom:link href="http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Hemendra Singh</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-108098</link>
		<dc:creator><![CDATA[Hemendra Singh]]></dc:creator>
		<pubDate>Mon, 27 Dec 2010 07:29:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-108098</guid>
		<description><![CDATA[Hi, Dave and all the members.

I really like all the above benchmarks that you described above, except the note  regarding &#039;Triggers&#039;.

I personally feel, triggers can really simplify many things, and can automate a lot of work, which you would otherwise would have to do through programming. In turn the load on the server will decrease, as no external connections for the database will be required and one would be relieved of the task of programming every program where database automation is required.


So, i personally would promote the use of triggers, especially for large databases, with lot of rows, to reduce the overhead , for implicit automation from the database, etc.]]></description>
		<content:encoded><![CDATA[<p>Hi, Dave and all the members.</p>
<p>I really like all the above benchmarks that you described above, except the note  regarding &#8216;Triggers&#8217;.</p>
<p>I personally feel, triggers can really simplify many things, and can automate a lot of work, which you would otherwise would have to do through programming. In turn the load on the server will decrease, as no external connections for the database will be required and one would be relieved of the task of programming every program where database automation is required.</p>
<p>So, i personally would promote the use of triggers, especially for large databases, with lot of rows, to reduce the overhead , for implicit automation from the database, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-56137</link>
		<dc:creator><![CDATA[Joe]]></dc:creator>
		<pubDate>Thu, 24 Sep 2009 17:17:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-56137</guid>
		<description><![CDATA[Hi Dave

I am in the process of creating mailing lables list from my Customer Table..

FirstName, Last Name, Address1, Address2, City, State, Zip.. are the fields.

I would like to print the labels for each customer record like

First Name + LastName
Address1+Address2+City+State+Zip 

and want them horizantally.

Can you help me?


I tried, with three list boxes, and 2nd and 3rd list box record values comes up with line feed while deploy on server..

Pls help me how to create mailing labels report using SSRS 08.]]></description>
		<content:encoded><![CDATA[<p>Hi Dave</p>
<p>I am in the process of creating mailing lables list from my Customer Table..</p>
<p>FirstName, Last Name, Address1, Address2, City, State, Zip.. are the fields.</p>
<p>I would like to print the labels for each customer record like</p>
<p>First Name + LastName<br />
Address1+Address2+City+State+Zip </p>
<p>and want them horizantally.</p>
<p>Can you help me?</p>
<p>I tried, with three list boxes, and 2nd and 3rd list box record values comes up with line feed while deploy on server..</p>
<p>Pls help me how to create mailing labels report using SSRS 08.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: piminh</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-46725</link>
		<dc:creator><![CDATA[piminh]]></dc:creator>
		<pubDate>Mon, 16 Feb 2009 04:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-46725</guid>
		<description><![CDATA[May I replace the OR statements by UNION. I searched it on internet. and it&#039;s useful for me, but when i run it use your script( calculate time ) on this site. it&#039;s wrong. Could you explain to me?]]></description>
		<content:encoded><![CDATA[<p>May I replace the OR statements by UNION. I searched it on internet. and it&#8217;s useful for me, but when i run it use your script( calculate time ) on this site. it&#8217;s wrong. Could you explain to me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-44562</link>
		<dc:creator><![CDATA[Doug]]></dc:creator>
		<pubDate>Fri, 05 Dec 2008 17:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-44562</guid>
		<description><![CDATA[Is there a good reason to use uppercase names for keywords, or is it a &quot;tradition&quot;?  Do certain SQL parsers choke on lower case?  My experience is with MS SQL only, which works with any case I use.

Every other language I use, C#, VB, JS, English, uses lower case or possibly mixed case.

I&#039;ve been trained to look at words with all uppercase as YELLING or acronyms.  When I see SQL statments with all caps, it reminds me of times when character sets, keyboards and parsers couldn&#039;t handle both upper and lower case characters.  Can we move past that those traditions?

If the only reason to capitalize keywords, is because everyone is doing it, that&#039;s not good enough.  It makes yound developers think there is some mysterious magic involved in writing stored procedures.

Personally I like Sentence Case or lower case.  The modern IDE&#039;s will highlight keywords, so that they stand out.]]></description>
		<content:encoded><![CDATA[<p>Is there a good reason to use uppercase names for keywords, or is it a &#8220;tradition&#8221;?  Do certain SQL parsers choke on lower case?  My experience is with MS SQL only, which works with any case I use.</p>
<p>Every other language I use, C#, VB, JS, English, uses lower case or possibly mixed case.</p>
<p>I&#8217;ve been trained to look at words with all uppercase as YELLING or acronyms.  When I see SQL statments with all caps, it reminds me of times when character sets, keyboards and parsers couldn&#8217;t handle both upper and lower case characters.  Can we move past that those traditions?</p>
<p>If the only reason to capitalize keywords, is because everyone is doing it, that&#8217;s not good enough.  It makes yound developers think there is some mysterious magic involved in writing stored procedures.</p>
<p>Personally I like Sentence Case or lower case.  The modern IDE&#8217;s will highlight keywords, so that they stand out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kishore Kumar</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-42119</link>
		<dc:creator><![CDATA[Kishore Kumar]]></dc:creator>
		<pubDate>Thu, 28 Aug 2008 06:42:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-42119</guid>
		<description><![CDATA[We have a database where we would like to enforce naming conventions.
We have rules for tables, views, procedures .... but we just look at enforcing the naming convention on tables.

The rule is :

                All table names should start with “companyName_”.

                Which new SQL 2005 feature will let us do this ?

               how we can write a T-SQL script that implement this rule]]></description>
		<content:encoded><![CDATA[<p>We have a database where we would like to enforce naming conventions.<br />
We have rules for tables, views, procedures &#8230;. but we just look at enforcing the naming convention on tables.</p>
<p>The rule is :</p>
<p>                All table names should start with “companyName_”.</p>
<p>                Which new SQL 2005 feature will let us do this ?</p>
<p>               how we can write a T-SQL script that implement this rule</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: G Arun</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-37602</link>
		<dc:creator><![CDATA[G Arun]]></dc:creator>
		<pubDate>Mon, 12 May 2008 11:17:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-37602</guid>
		<description><![CDATA[Hi Dave

This is very useful one to learn more abt stopred proc. 

All the best for ur future plans in SQL Server......


Regards
G Arun]]></description>
		<content:encoded><![CDATA[<p>Hi Dave</p>
<p>This is very useful one to learn more abt stopred proc. </p>
<p>All the best for ur future plans in SQL Server&#8230;&#8230;</p>
<p>Regards<br />
G Arun</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Campbell</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-37069</link>
		<dc:creator><![CDATA[Steve Campbell]]></dc:creator>
		<pubDate>Tue, 06 May 2008 15:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-37069</guid>
		<description><![CDATA[&quot;In VARCHAR data columns, do not default to NULL; use an empty string instead&quot;

Why?]]></description>
		<content:encoded><![CDATA[<p>&#8220;In VARCHAR data columns, do not default to NULL; use an empty string instead&#8221;</p>
<p>Why?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhan</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-25092</link>
		<dc:creator><![CDATA[Madhan]]></dc:creator>
		<pubDate>Sun, 09 Dec 2007 18:08:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-25092</guid>
		<description><![CDATA[The Guidelines will be really helpful for a rookie programmer. 

As per my personal opinion,I don&#039;t think on any given day any DB programmer will assent the use of TRIGGERS in any perspective unless we maintain a meagre amount of records. Using tirgger is always like jogging on a sludge. The role of triggers are efficiently played by the CONSTRAINTS. A TABLE is well manipulated by using constraints and triggers should be used only as a last resort.]]></description>
		<content:encoded><![CDATA[<p>The Guidelines will be really helpful for a rookie programmer. </p>
<p>As per my personal opinion,I don&#8217;t think on any given day any DB programmer will assent the use of TRIGGERS in any perspective unless we maintain a meagre amount of records. Using tirgger is always like jogging on a sludge. The role of triggers are efficiently played by the CONSTRAINTS. A TABLE is well manipulated by using constraints and triggers should be used only as a last resort.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bjorn</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-16982</link>
		<dc:creator><![CDATA[Bjorn]]></dc:creator>
		<pubDate>Thu, 01 Nov 2007 10:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-16982</guid>
		<description><![CDATA[I never really got past the &quot;Notes: The use of triggers is discouraged&quot;. The reason is that I dislike and distrust statements without a reason why they are made. Triggers are *very* useful for securing data integrity, i.e. protecting the data, even though they slow down data updates.
I&#039;m not accepting all you naming standards either, but then I feel that as long as you keep to a standard you may name things (almost) any way you like. :-) ... and sometimes one needs ideas/suggestions.
And George, sometimes you have to look at the data from another viewpoint than the table. In a table the name numId makes sense, but in a query (or elsewhere) it might tell you nothing (i.e. makes it harder to make sense of it).]]></description>
		<content:encoded><![CDATA[<p>I never really got past the &#8220;Notes: The use of triggers is discouraged&#8221;. The reason is that I dislike and distrust statements without a reason why they are made. Triggers are *very* useful for securing data integrity, i.e. protecting the data, even though they slow down data updates.<br />
I&#8217;m not accepting all you naming standards either, but then I feel that as long as you keep to a standard you may name things (almost) any way you like. :-) &#8230; and sometimes one needs ideas/suggestions.<br />
And George, sometimes you have to look at the data from another viewpoint than the table. In a table the name numId makes sense, but in a query (or elsewhere) it might tell you nothing (i.e. makes it harder to make sense of it).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-11361</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Thu, 06 Sep 2007 03:27:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-11361</guid>
		<description><![CDATA[Thank you George,

Your feedback is very valuable. As you said &quot;It’s always good to see how others are implementing their solutions.&quot; Every programmer has their view and every corporation has their policy. I enjoyed reading your opinion and it has all good points.

Kind Regards,
Pinal Dave ( http://www.SQLAuthority.com )]]></description>
		<content:encoded><![CDATA[<p>Thank you George,</p>
<p>Your feedback is very valuable. As you said &#8220;It’s always good to see how others are implementing their solutions.&#8221; Every programmer has their view and every corporation has their policy. I enjoyed reading your opinion and it has all good points.</p>
<p>Kind Regards,<br />
Pinal Dave ( <a href="http://www.SQLAuthority.com" rel="nofollow">http://www.SQLAuthority.com</a> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-11357</link>
		<dc:creator><![CDATA[George]]></dc:creator>
		<pubDate>Thu, 06 Sep 2007 03:07:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-11357</guid>
		<description><![CDATA[Nice discussion and the feedback has been a good exchange of personal views which is always nice to see.  

My two cents worth:

1.  I use the Singular form for table names.  Customer, Account, etc.
2.  I do use numID to represent the PK of all my tables.  Since the ID belongs to the table Customer, I don&#039;t feel the need to qualify it with CustomerID.  It&#039;s given.
3.  In the case of an Employee who has a supervisor reference, you still end up with:

Table: Employee
PK: numID
Col: numSupervisorID
Col: txtName
Col: txtAddress1
Col: numStateID
Col: dteCreated
Col: dteModified

etc..

In this case, numSupervisorID also references a row in the Employee table, so even with data modelling packages, the column must be renamed because it can&#039;t pull in numID again.

One could argue that you could have an intersection table back to itself for Supervisors, but that seems like overkill in this case.

4.  I like the use of table prefixes.  We used them heavily at one of my other companies and it help identify a table&#039;s intended use right away.  tbli (intersection table), tbl (standard data table), tblw (working or temp table), tlbv (used for a view), etc...

It&#039;s always good to see how others are implementing their solutions.]]></description>
		<content:encoded><![CDATA[<p>Nice discussion and the feedback has been a good exchange of personal views which is always nice to see.  </p>
<p>My two cents worth:</p>
<p>1.  I use the Singular form for table names.  Customer, Account, etc.<br />
2.  I do use numID to represent the PK of all my tables.  Since the ID belongs to the table Customer, I don&#8217;t feel the need to qualify it with CustomerID.  It&#8217;s given.<br />
3.  In the case of an Employee who has a supervisor reference, you still end up with:</p>
<p>Table: Employee<br />
PK: numID<br />
Col: numSupervisorID<br />
Col: txtName<br />
Col: txtAddress1<br />
Col: numStateID<br />
Col: dteCreated<br />
Col: dteModified</p>
<p>etc..</p>
<p>In this case, numSupervisorID also references a row in the Employee table, so even with data modelling packages, the column must be renamed because it can&#8217;t pull in numID again.</p>
<p>One could argue that you could have an intersection table back to itself for Supervisors, but that seems like overkill in this case.</p>
<p>4.  I like the use of table prefixes.  We used them heavily at one of my other companies and it help identify a table&#8217;s intended use right away.  tbli (intersection table), tbl (standard data table), tblw (working or temp table), tlbv (used for a view), etc&#8230;</p>
<p>It&#8217;s always good to see how others are implementing their solutions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: saravanan</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-10366</link>
		<dc:creator><![CDATA[saravanan]]></dc:creator>
		<pubDate>Fri, 31 Aug 2007 05:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-10366</guid>
		<description><![CDATA[respected sir

i am saravanan, and i have finished B.Tech(IT), i want to learn the sql server 2005 with excellent knowledge. can you help me to learn well....please send all the tips and tricks in sqlserver]]></description>
		<content:encoded><![CDATA[<p>respected sir</p>
<p>i am saravanan, and i have finished B.Tech(IT), i want to learn the sql server 2005 with excellent knowledge. can you help me to learn well&#8230;.please send all the tips and tricks in sqlserver</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-5868</link>
		<dc:creator><![CDATA[Russ]]></dc:creator>
		<pubDate>Wed, 25 Jul 2007 18:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-5868</guid>
		<description><![CDATA[I agree with Rich about the ID, but not the table name. The table is Customers and the ID should be CustomerID. The ID refers to one Customer where as the table is a collection of Customers.

I do, however, add a prefix to tables. I use tbl, tbk and tmp to separate types of tables. tbl&#039;s are the standard data tables.

tbk&#039;s are lookup tables or contain data which doesn&#039;t change often, such as tbkStates or tbkAddressTypes. tbkAddressTypes might contain AddressTypeID and AddressType which would include Mailing, Billing, Warehouse, etc.

I use tmp for temporary storage tables such as importing customer information from a flat file and messaging it before entry into the tblCustomers table. By having the tmp in front of it, other developers know that this does not contain data that should be counted on for any validity.]]></description>
		<content:encoded><![CDATA[<p>I agree with Rich about the ID, but not the table name. The table is Customers and the ID should be CustomerID. The ID refers to one Customer where as the table is a collection of Customers.</p>
<p>I do, however, add a prefix to tables. I use tbl, tbk and tmp to separate types of tables. tbl&#8217;s are the standard data tables.</p>
<p>tbk&#8217;s are lookup tables or contain data which doesn&#8217;t change often, such as tbkStates or tbkAddressTypes. tbkAddressTypes might contain AddressTypeID and AddressType which would include Mailing, Billing, Warehouse, etc.</p>
<p>I use tmp for temporary storage tables such as importing customer information from a flat file and messaging it before entry into the tblCustomers table. By having the tmp in front of it, other developers know that this does not contain data that should be counted on for any validity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-5815</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Tue, 24 Jul 2007 22:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-5815</guid>
		<description><![CDATA[Rich,

I appreciate your feedback.

Regards,
Pinal (SQLAuthority.com)]]></description>
		<content:encoded><![CDATA[<p>Rich,</p>
<p>I appreciate your feedback.</p>
<p>Regards,<br />
Pinal (SQLAuthority.com)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-5814</link>
		<dc:creator><![CDATA[Rich]]></dc:creator>
		<pubDate>Tue, 24 Jul 2007 21:43:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/04/sql-server-database-coding-standards-and-guidelines-part-1/#comment-5814</guid>
		<description><![CDATA[Of course, this mainly just personal taste. I agree with most of your conventions, with the exception of the following:

1) Plural table names - Should be Singular
2) Pks, which I agree are typically an identity, should be &quot;Table Name&quot; + ID.

My reasoning for this comes from a data modeling perspective. In my view, a key should change names only under rare circumstances. In your scenario, keys change names quite frequently as they become FKs. In your CustomerId example above, the key changes names from ID to CustomerId. In this case, the PK of the Customer table should be CustomerId as well.

Most Data Modeling tools will default to this behavior as well. When creating an FK, the default name of the FK is the same name as the source PK.

Under your naming convention, if you believe table names should be plural, then the name of your FK should be really be CustomersId (note the xtra &#039;S&#039;).

This is just personal opinion, but I think naming ANY column &#039;ID&#039; is a bad idea. A &quot;CustomerId&quot; should be CustomerId is all tables if it contains the same thing.]]></description>
		<content:encoded><![CDATA[<p>Of course, this mainly just personal taste. I agree with most of your conventions, with the exception of the following:</p>
<p>1) Plural table names &#8211; Should be Singular<br />
2) Pks, which I agree are typically an identity, should be &#8220;Table Name&#8221; + ID.</p>
<p>My reasoning for this comes from a data modeling perspective. In my view, a key should change names only under rare circumstances. In your scenario, keys change names quite frequently as they become FKs. In your CustomerId example above, the key changes names from ID to CustomerId. In this case, the PK of the Customer table should be CustomerId as well.</p>
<p>Most Data Modeling tools will default to this behavior as well. When creating an FK, the default name of the FK is the same name as the source PK.</p>
<p>Under your naming convention, if you believe table names should be plural, then the name of your FK should be really be CustomersId (note the xtra &#8216;S&#8217;).</p>
<p>This is just personal opinion, but I think naming ANY column &#8216;ID&#8217; is a bad idea. A &#8220;CustomerId&#8221; should be CustomerId is all tables if it contains the same thing.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
