<?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/"
		>
<channel>
	<title>Comments on: Using aliases in multi-table queries</title>
	<atom:link href="http://www.brentozar.com/archive/2009/04/using-aliases-in-multi-table-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brentozar.com/archive/2009/04/using-aliases-in-multi-table-queries/</link>
	<description>Your technology pain-relief experts.</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:37:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: CrankyRat</title>
		<link>http://www.brentozar.com/archive/2009/04/using-aliases-in-multi-table-queries/comment-page-1/#comment-8746</link>
		<dc:creator>CrankyRat</dc:creator>
		<pubDate>Thu, 07 May 2009 00:26:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.brentozar.com/?p=3144#comment-8746</guid>
		<description>Funny, I hate multiple letter alias or full table name alias. That is painful for me. Keeping it to a single letter is my preference. The important thing is to use an alias; the rest is personal preference. The &#039;dbo&#039; prefix may be recommended but is pretty stupid on the face of it, bloats code and obscures meaning. Having an Oracle background I can&#039;t bring myself to use it in this shop.</description>
		<content:encoded><![CDATA[<p>Funny, I hate multiple letter alias or full table name alias. That is painful for me. Keeping it to a single letter is my preference. The important thing is to use an alias; the rest is personal preference. The &#8216;dbo&#8217; prefix may be recommended but is pretty stupid on the face of it, bloats code and obscures meaning. Having an Oracle background I can&#8217;t bring myself to use it in this shop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent Ozar</title>
		<link>http://www.brentozar.com/archive/2009/04/using-aliases-in-multi-table-queries/comment-page-1/#comment-8336</link>
		<dc:creator>Brent Ozar</dc:creator>
		<pubDate>Mon, 13 Apr 2009 19:25:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.brentozar.com/?p=3144#comment-8336</guid>
		<description>Absolutely, great question.  Every table in the database NOW is dbo, but that&#039;s not necessarily true for the future.  I&#039;ve seen a lot of projects where a new round of developers or a new project will need to add an additional schema for security needs, and then it&#039;s an absolute mess to go back and fix the code everywhere.</description>
		<content:encoded><![CDATA[<p>Absolutely, great question.  Every table in the database NOW is dbo, but that&#8217;s not necessarily true for the future.  I&#8217;ve seen a lot of projects where a new round of developers or a new project will need to add an additional schema for security needs, and then it&#8217;s an absolute mess to go back and fix the code everywhere.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David L. Penton</title>
		<link>http://www.brentozar.com/archive/2009/04/using-aliases-in-multi-table-queries/comment-page-1/#comment-8335</link>
		<dc:creator>David L. Penton</dc:creator>
		<pubDate>Mon, 13 Apr 2009 19:25:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.brentozar.com/?p=3144#comment-8335</guid>
		<description>David,

See: http://msdn.microsoft.com/en-us/library/ms189915.aspx

Microsoft recommends you at least owner-qualifying your object names.


Executing User-defined Stored Procedures

When executing a user-defined stored procedure (either in a batch or inside a module such as a user-defined stored procedure or function), we strongly recommend qualifying the stored procedure name with at least the schema name.

The following example demonstrates the recommended method for executing a user-defined stored procedure.

USE AdventureWorks;
GO
EXEC dbo.uspGetEmployeeManagers 50;

-Or-

EXEC AdventureWorks.dbo.uspGetEmployeeManagers 50;
GO

If a nonqualified user-defined stored procedure is specified, the Database Engine searches for the procedure in the following order:

    * The sys schema of the current database.
    * The caller&#039;s default schema if executed in a batch or in dynamic SQL. Or, if the nonqualified procedure name appears inside the body of another procedure definition, the schema containing this other procedure is searched next. For more information about default schemas, see User-Schema Separation.
    * The dbo schema in the current database.

Important:
If any user-created stored procedure has the same name as a system stored procedure, the user-created stored procedure will never be executed if you use a nonschema-qualified name reference. For more information, see Creating Stored Procedures (Database Engine).
</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>See: <a href="http://msdn.microsoft.com/en-us/library/ms189915.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms189915.aspx</a></p>
<p>Microsoft recommends you at least owner-qualifying your object names.</p>
<p>Executing User-defined Stored Procedures</p>
<p>When executing a user-defined stored procedure (either in a batch or inside a module such as a user-defined stored procedure or function), we strongly recommend qualifying the stored procedure name with at least the schema name.</p>
<p>The following example demonstrates the recommended method for executing a user-defined stored procedure.</p>
<p>USE AdventureWorks;<br />
GO<br />
EXEC dbo.uspGetEmployeeManagers 50;</p>
<p>-Or-</p>
<p>EXEC AdventureWorks.dbo.uspGetEmployeeManagers 50;<br />
GO</p>
<p>If a nonqualified user-defined stored procedure is specified, the Database Engine searches for the procedure in the following order:</p>
<p>    * The sys schema of the current database.<br />
    * The caller&#8217;s default schema if executed in a batch or in dynamic SQL. Or, if the nonqualified procedure name appears inside the body of another procedure definition, the schema containing this other procedure is searched next. For more information about default schemas, see User-Schema Separation.<br />
    * The dbo schema in the current database.</p>
<p>Important:<br />
If any user-created stored procedure has the same name as a system stored procedure, the user-created stored procedure will never be executed if you use a nonschema-qualified name reference. For more information, see Creating Stored Procedures (Database Engine).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stein</title>
		<link>http://www.brentozar.com/archive/2009/04/using-aliases-in-multi-table-queries/comment-page-1/#comment-8334</link>
		<dc:creator>David Stein</dc:creator>
		<pubDate>Mon, 13 Apr 2009 19:21:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.brentozar.com/?p=3144#comment-8334</guid>
		<description>Brent, is the dbo. really necessary?  Is there some reason why that should be included if every table in the database is dbo?</description>
		<content:encoded><![CDATA[<p>Brent, is the dbo. really necessary?  Is there some reason why that should be included if every table in the database is dbo?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Object Caching 534/539 objects using disk: basic

Served from: www.brentozar.com @ 2012-02-09 04:53:25 -->
