<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Implements IVillage - SQL Server</title>
    <link>http://www.implementsivillage.net/</link>
    <description>It takes a village to keep up with .Net</description>
    <language>en-us</language>
    <copyright>Christian M Loris</copyright>
    <lastBuildDate>Thu, 08 Oct 2009 00:28:15 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.6264.0</generator>
    <managingEditor>cloris@lorisc.com</managingEditor>
    <webMaster>cloris@lorisc.com</webMaster>
    <item>
      <trackback:ping>http://www.implementsivillage.net/Trackback.aspx?guid=24d08dd2-550d-46e6-8709-dcee741a9bc3</trackback:ping>
      <pingback:server>http://www.implementsivillage.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.implementsivillage.net/PermaLink,guid,24d08dd2-550d-46e6-8709-dcee741a9bc3.aspx</pingback:target>
      <dc:creator>Christian Loris</dc:creator>
      <wfw:comment>http://www.implementsivillage.net/CommentView,guid,24d08dd2-550d-46e6-8709-dcee741a9bc3.aspx</wfw:comment>
      <wfw:commentRss>http://www.implementsivillage.net/SyndicationService.asmx/GetEntryCommentsRss?guid=24d08dd2-550d-46e6-8709-dcee741a9bc3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Giving a presentation on using SSIS to handle Slowly Changin Dimensions tomorrow night
at the Space Coast SQL User Group.  Goto <a href="http://spacecoast.sqlpass.org">http://spacecoast.sqlpass.org</a> for
details.  If you can't make it, then try and catch me at SQL Saturday on the
17th - <a href="http://www.sqlsaturday.com/eventhome.aspx?eventid=32">http://www.sqlsaturday.com/eventhome.aspx?eventid=32</a></p>
        <p>
The run this Thursday will be the dry run so come to see me bumble through the presentation. 
Come the Saturday to see the polished version.
</p>
        <img width="0" height="0" src="http://www.implementsivillage.net/aggbug.ashx?id=24d08dd2-550d-46e6-8709-dcee741a9bc3" />
      </body>
      <title>Speaking at Space Coast SQL User Group - SSIS and SCDs</title>
      <guid isPermaLink="false">http://www.implementsivillage.net/PermaLink,guid,24d08dd2-550d-46e6-8709-dcee741a9bc3.aspx</guid>
      <link>http://www.implementsivillage.net/PermaLink,guid,24d08dd2-550d-46e6-8709-dcee741a9bc3.aspx</link>
      <pubDate>Thu, 08 Oct 2009 00:28:15 GMT</pubDate>
      <description>&lt;p&gt;
Giving a presentation on using SSIS to handle Slowly Changin Dimensions tomorrow night
at the Space Coast SQL User Group.&amp;nbsp; Goto &lt;a href="http://spacecoast.sqlpass.org"&gt;http://spacecoast.sqlpass.org&lt;/a&gt; for
details.&amp;nbsp; If you can't make it, then try and catch me at SQL Saturday on the
17th - &lt;a href="http://www.sqlsaturday.com/eventhome.aspx?eventid=32"&gt;http://www.sqlsaturday.com/eventhome.aspx?eventid=32&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The run this Thursday will be the dry run so come to see me bumble through the presentation.&amp;nbsp;
Come the Saturday to see the polished version.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.implementsivillage.net/aggbug.ashx?id=24d08dd2-550d-46e6-8709-dcee741a9bc3" /&gt;</description>
      <comments>http://www.implementsivillage.net/CommentView,guid,24d08dd2-550d-46e6-8709-dcee741a9bc3.aspx</comments>
      <category>Learning;SQL Server;User Group</category>
    </item>
    <item>
      <trackback:ping>http://www.implementsivillage.net/Trackback.aspx?guid=87666561-ec46-42a0-8a0f-dc743921d4a5</trackback:ping>
      <pingback:server>http://www.implementsivillage.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.implementsivillage.net/PermaLink,guid,87666561-ec46-42a0-8a0f-dc743921d4a5.aspx</pingback:target>
      <dc:creator>Christian Loris</dc:creator>
      <wfw:comment>http://www.implementsivillage.net/CommentView,guid,87666561-ec46-42a0-8a0f-dc743921d4a5.aspx</wfw:comment>
      <wfw:commentRss>http://www.implementsivillage.net/SyndicationService.asmx/GetEntryCommentsRss?guid=87666561-ec46-42a0-8a0f-dc743921d4a5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
SQLSaturday is a training event for SQL Server professionals and those wanting to
learn about SQL Server. This event will be held October 17, 2009 at Seminole Community
College, 100 Weldon Boulevard, Sanford, FL 32773. Admittance to this event is free,
but to to the challenging nature of fund raising this year there will be a $10 fee
due at registration to cover the cost of lunch (a great boxed lunch from Jason's Deli).
All other costs are covered by donations and sponsorships. Please register soon as
seating is limited, and let friends and colleages know about the event.
</p>
        <p>
More Info: <a href="http://www.sqlsaturday.com/eventhome.aspx?eventid=32">http://www.sqlsaturday.com/eventhome.aspx?eventid=32</a></p>
        <img width="0" height="0" src="http://www.implementsivillage.net/aggbug.ashx?id=87666561-ec46-42a0-8a0f-dc743921d4a5" />
      </body>
      <title>SQL Saturday #21 in Orlando Oct. 17th</title>
      <guid isPermaLink="false">http://www.implementsivillage.net/PermaLink,guid,87666561-ec46-42a0-8a0f-dc743921d4a5.aspx</guid>
      <link>http://www.implementsivillage.net/PermaLink,guid,87666561-ec46-42a0-8a0f-dc743921d4a5.aspx</link>
      <pubDate>Mon, 05 Oct 2009 17:02:16 GMT</pubDate>
      <description>&lt;p&gt;
SQLSaturday is a training event for SQL Server professionals and those wanting to
learn about SQL Server. This event will be held October 17, 2009 at Seminole Community
College, 100 Weldon Boulevard, Sanford, FL 32773. Admittance to this event is free,
but to to the challenging nature of fund raising this year there will be a $10 fee
due at registration to cover the cost of lunch (a great boxed lunch from Jason's Deli).
All other costs are covered by donations and sponsorships. Please register soon as
seating is limited, and let friends and colleages know about the event.
&lt;/p&gt;
&lt;p&gt;
More Info: &lt;a href="http://www.sqlsaturday.com/eventhome.aspx?eventid=32"&gt;http://www.sqlsaturday.com/eventhome.aspx?eventid=32&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.implementsivillage.net/aggbug.ashx?id=87666561-ec46-42a0-8a0f-dc743921d4a5" /&gt;</description>
      <comments>http://www.implementsivillage.net/CommentView,guid,87666561-ec46-42a0-8a0f-dc743921d4a5.aspx</comments>
      <category>Learning;SQL Server;User Group</category>
    </item>
    <item>
      <trackback:ping>http://www.implementsivillage.net/Trackback.aspx?guid=7b2d11eb-eeff-4fd1-b045-57ae867dcb2a</trackback:ping>
      <pingback:server>http://www.implementsivillage.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.implementsivillage.net/PermaLink,guid,7b2d11eb-eeff-4fd1-b045-57ae867dcb2a.aspx</pingback:target>
      <dc:creator>Christian Loris</dc:creator>
      <wfw:comment>http://www.implementsivillage.net/CommentView,guid,7b2d11eb-eeff-4fd1-b045-57ae867dcb2a.aspx</wfw:comment>
      <wfw:commentRss>http://www.implementsivillage.net/SyndicationService.asmx/GetEntryCommentsRss?guid=7b2d11eb-eeff-4fd1-b045-57ae867dcb2a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is impossible.  Don't try.  There are a few 'hacky' ways to do this,
but why? It can be doneif you slightly modify the requirement. If you can
abandon the use of a stored procedure for a User Defined Function, you can use an
Inline Table-Value User-Defined Function. This is essentially a stored proc (will
take parameters) that returns a table as a result set; and therefore will place nicely
with an INTO statement. Here's a good <a href="http://www.sqlteam.com/article/user-defined-functions" rel="nofollow">quick
article</a> on it and other user defiend functions. If you still have a driving need
for a Stored Procedure, you can wrap the Inline Table-Value User-Defined Function
with a stored procedure. The stored proc just passes parameters when it calls select
* from the Inline Table-Value User-Defined Function. 
</p>
        <p>
So for instance, you'd have a Inline Table-Value User-Defined Function to get a list
of customers for a particular region:
</p>
        <pre class="prettyprint" sizcache="4" sizset="5" jquery1249579809263="94">
          <code>
            <span class="pln">
              <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CREATE</span>
                    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FUNCTION</span> ufCustomersByRegion
(@RegionID <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span>)</span>
                </p>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">RETURNS <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">TABLE</span></span>
                </p>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span>
                </p>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">RETURN <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> * <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> customers <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span> RegionID
= @RegionIDGO</span>
                </p>
              </blockquote>
              <br />
            </span>
          </code>You can then call this function to get what your results a such:</pre>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <pre class="prettyprint" sizcache="4" sizset="6" jquery1249579809263="95">
            <code>
              <span class="pln">
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> * <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> CustomersbyRegion(1)</span>
                </p>
              </span>
            </code>
          </pre>
        </blockquote>
        <p>
Or to do a SELECT INTO:
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <pre class="prettyprint" sizcache="4" sizset="7" jquery1249579809263="96">
            <code>
              <span class="pln">
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> * <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">INTO</span> CustList <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> CustomersbyRegion(1)</span>
                </p>
              </span>
            </code>
          </pre>
        </blockquote>
        <p>
If you still need a stored proc, then wrap the function as such:
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <pre class="prettyprint" sizcache="4" sizset="8" jquery1249579809263="97">
            <code>
              <span class="pln">
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CREATE</span>
                    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">PROCEDURE</span> uspCustomersByRegion</span>
                </p>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"> @regionID <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span></span>
                </p>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span>
                </p>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BEGIN</span>
                </p>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> * <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> CustomersbyRegion(@regionID);</span>
                </p>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">END</span>
                </p>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">GO</span>
                </p>
              </span>
            </code>
          </pre>
        </blockquote>
        <p>
I think this is the most 'hack-less' method to obtain the desired results. It uses
the existing features as they were intended to be used without additional complications.
By nesting the Inline Table-Value User-Defined Function in the stored proc, you have
access to the functionality in two ways. Plus! You have only one point of maintenance
for the actual SQL code.
</p>
        <img width="0" height="0" src="http://www.implementsivillage.net/aggbug.ashx?id=7b2d11eb-eeff-4fd1-b045-57ae867dcb2a" />
      </body>
      <title>How To Select Into from a Stored Procedure (SQL2005+)</title>
      <guid isPermaLink="false">http://www.implementsivillage.net/PermaLink,guid,7b2d11eb-eeff-4fd1-b045-57ae867dcb2a.aspx</guid>
      <link>http://www.implementsivillage.net/PermaLink,guid,7b2d11eb-eeff-4fd1-b045-57ae867dcb2a.aspx</link>
      <pubDate>Thu, 06 Aug 2009 17:37:07 GMT</pubDate>
      <description>&lt;p&gt;
This is impossible.&amp;nbsp; Don't try.&amp;nbsp; There are a few 'hacky' ways to do this,
but why? It can be doneif you&amp;nbsp;slightly modify&amp;nbsp;the requirement. If you can
abandon the use of a stored procedure for a User Defined Function, you can use an
Inline Table-Value User-Defined Function. This is essentially a stored proc (will
take parameters) that returns a table as a result set; and therefore will place nicely
with an INTO statement. Here's a good &lt;a href="http://www.sqlteam.com/article/user-defined-functions" rel=nofollow&gt;quick
article&lt;/a&gt; on it and other user defiend functions. If you still have a driving need
for a Stored Procedure, you can wrap the Inline Table-Value User-Defined Function
with a stored procedure. The stored proc just passes parameters when it calls select
* from the Inline Table-Value User-Defined Function. 
&lt;/p&gt;
&lt;p&gt;
So for instance, you'd have a Inline Table-Value User-Defined Function to get a list
of customers for a particular region:
&lt;/p&gt;
&lt;pre class=prettyprint sizcache="4" sizset="5" jquery1249579809263="94"&gt;&lt;code&gt;&lt;span class=pln&gt;&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;CREATE&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FUNCTION&lt;/span&gt; ufCustomersByRegion
(@RegionID &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt;)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;RETURNS &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;TABLE&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;RETURN &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; * &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; customers &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;WHERE&lt;/span&gt; RegionID
= @RegionIDGO&lt;/span&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;/span&gt;&lt;/code&gt;You can then call this function to get what your results a such:&lt;/pre&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;pre class=prettyprint sizcache="4" sizset="6" jquery1249579809263="95"&gt;&lt;code&gt;&lt;span class=pln&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; * &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; CustomersbyRegion(1)&lt;/span&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Or to do a SELECT INTO:
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;pre class=prettyprint sizcache="4" sizset="7" jquery1249579809263="96"&gt;&lt;code&gt;&lt;span class=pln&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; * &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;INTO&lt;/span&gt; CustList &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; CustomersbyRegion(1)&lt;/span&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
If you still need a stored proc, then wrap the function as such:
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;pre class=prettyprint sizcache="4" sizset="8" jquery1249579809263="97"&gt;&lt;code&gt;&lt;span class=pln&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;CREATE&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;PROCEDURE&lt;/span&gt; uspCustomersByRegion&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; @regionID &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BEGIN&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; * &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; CustomersbyRegion(@regionID);&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;END&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;GO&lt;/span&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
I think this is the most 'hack-less' method to obtain the desired results. It uses
the existing features as they were intended to be used without additional complications.
By nesting the Inline Table-Value User-Defined Function in the stored proc, you have
access to the functionality in two ways. Plus! You have only one point of maintenance
for the actual SQL code.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.implementsivillage.net/aggbug.ashx?id=7b2d11eb-eeff-4fd1-b045-57ae867dcb2a" /&gt;</description>
      <comments>http://www.implementsivillage.net/CommentView,guid,7b2d11eb-eeff-4fd1-b045-57ae867dcb2a.aspx</comments>
      <category>SQL Server</category>
    </item>
  </channel>
</rss>