<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>youdidwhatwithtsql.com &#187; temporary tables</title>
	<atom:link href="http://www.youdidwhatwithtsql.com/tag/temporary-tables/feed" rel="self" type="application/rss+xml" />
	<link>http://www.youdidwhatwithtsql.com</link>
	<description>making DBAs everywhere curse!</description>
	<lastBuildDate>Wed, 01 Sep 2010 17:02:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Temporary &amp; Custom Database Object Naming</title>
		<link>http://www.youdidwhatwithtsql.com/temporary-custom-database-object-naming/102</link>
		<comments>http://www.youdidwhatwithtsql.com/temporary-custom-database-object-naming/102#comments</comments>
		<pubDate>Tue, 19 May 2009 18:24:11 +0000</pubDate>
		<dc:creator>Rhys</dc:creator>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[temporary database objects]]></category>
		<category><![CDATA[temporary tables]]></category>

		<guid isPermaLink="false">http://www.youdidwhatwithtsql.com/temporary-custom-database-object-naming/102</guid>
		<description><![CDATA[Over the years I’ve experienced various problems with temporary and custom database objects (as in objects created specifically for certain client systems). Development and deployment teams are often distinct and this can create issues. These issues have included; Temporary objects persisting for months or years beyond their initial purpose. Temporary objects spreading from development to [...]<p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/temporary-custom-database-object-naming/102">Temporary &amp; Custom Database Object Naming</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Over the years I’ve experienced various problems with temporary and custom database objects (as in objects created specifically for certain client systems). Development and deployment teams are often distinct and this can create issues. These issues have included;</p>
<ul>
<li>Temporary objects persisting for months or years beyond their initial purpose. </li>
<li>Temporary objects spreading from development to live environments. </li>
<li>Client specific objects spreading to other client systems. </li>
</ul>
<p>These issues can be exacerbated as developers leave the organisation and sometimes by reluctance to identify redundant objects. This is especially true in organisations with multiple systems accessing the same data sources. Who knows if that legacy system still running needs that table? Here are some conventions I have developed to try and eliminate these issues with minimal fuss.</p>
<p><strong>Temporary Naming Conventions</strong></p>
<ul>
<li>For objects only required on the created date start table names with ‘temp_’, i.e. </li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p102code4'); return false;">View Code</a> TSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1024"><td class="code" id="p102code4"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> temp_customer_import
<span style="color: #808080;">&#40;</span>
	<span style="color: #008080;">/*
	-- Table definition
	*/</span>
<span style="color: #808080;">&#41;</span>;</pre></td></tr></table></div>

<ul>
<li>For tables required for an indeterminate period of time start with ‘temp_&lt;contact_name&gt;’ where &lt;contact name&gt; is the person to check with as to its status. i.e. </li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p102code5'); return false;">View Code</a> TSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1025"><td class="code" id="p102code5"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> temp_rhyscampbell_customer_import
<span style="color: #808080;">&#40;</span>
	<span style="color: #008080;">/*
	-- Table definition
	*/</span>
<span style="color: #808080;">&#41;</span>;</pre></td></tr></table></div>

<p><strong>Client Specific Naming Conventions</strong></p>
<p>Often I have seen client specific stored procedures created in development environments which have then been deployed to other client sites.</p>
<ul>
<li>Include the company name in client specific database objects, i.e. </li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p102code6'); return false;">View Code</a> TSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1026"><td class="code" id="p102code6"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">PROCEDURE</span> usp_ACME_LTD_process_customer
<span style="color: #0000FF;">AS</span>
<span style="color: #0000FF;">BEGIN</span>
	<span style="color: #008080;">/*
	-- Proc definition
	*/</span>
<span style="color: #0000FF;">END</span></pre></td></tr></table></div>

<p>Adherence to these simple rules should solve many of these issues painlessly. Remember, a clean database, is a happy database!</p>
<p><map name='google_ad_map_102_a45beff5d2e172f6'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/102?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_102_a45beff5d2e172f6' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=102&amp;url=http%3A%2F%2Fwww.youdidwhatwithtsql.com%2Ftemporary-custom-database-object-naming%2F102' title="Temporary &amp; Custom Database Object Naming" alt=" Temporary &amp; Custom Database Object Naming" /></p><p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/temporary-custom-database-object-naming/102">Temporary &amp; Custom Database Object Naming</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.youdidwhatwithtsql.com/temporary-custom-database-object-naming/102/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
