<?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 for sqlity.net</title>
	<atom:link href="http://sqlity.net/en/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlity.net/en</link>
	<description>Quality for SQL</description>
	<lastBuildDate>Mon, 09 Apr 2012 10:35:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>Comment on Presentation Materials &#8211; Index Internals by 2012-04-12: Index Internals &#8211; SQL PASS Regionalgruppe Hamburg - sqlity.net &#124; sqlity.net</title>
		<link>http://sqlity.net/en/592/presentation-materials-index-internals/#comment-30</link>
		<dc:creator>2012-04-12: Index Internals &#8211; SQL PASS Regionalgruppe Hamburg - sqlity.net &#124; sqlity.net</dc:creator>
		<pubDate>Mon, 09 Apr 2012 10:35:54 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=592#comment-30</guid>
		<description>[...] TitleIndex Internals - How SQL Server stores and accesses data [...]</description>
		<content:encoded><![CDATA[<p>[...] TitleIndex Internals &#8211; How SQL Server stores and accesses data [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Gap in the Identity Value Sequence by A mock too far? What is good practice for mocking database objects with tSQLt?</title>
		<link>http://sqlity.net/en/792/the-gap-in-the-identity-value-sequence/#comment-29</link>
		<dc:creator>A mock too far? What is good practice for mocking database objects with tSQLt?</dc:creator>
		<pubDate>Wed, 28 Mar 2012 08:10:50 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=792#comment-29</guid>
		<description>[...] been rolled back – potentially leaving gaps in the IDENTITY sequence.  As Sebastian Meine says here, you cannot depend on unbroken identity sequences in a multi-user system (or when rollbacks may [...]</description>
		<content:encoded><![CDATA[<p>[...] been rolled back – potentially leaving gaps in the IDENTITY sequence.  As Sebastian Meine says here, you cannot depend on unbroken identity sequences in a multi-user system (or when rollbacks may [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Gap in the Identity Value Sequence by Unit Testing Databases with tSQLt Part 10 – testing a foreign key’s ON DELETE or ON UPDATE actions</title>
		<link>http://sqlity.net/en/792/the-gap-in-the-identity-value-sequence/#comment-28</link>
		<dc:creator>Unit Testing Databases with tSQLt Part 10 – testing a foreign key’s ON DELETE or ON UPDATE actions</dc:creator>
		<pubDate>Tue, 20 Mar 2012 20:21:51 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=792#comment-28</guid>
		<description>[...] primary key of the parent table is also an IDENTITY column. As Sebastian Meine points out in &#8220;The Gap In The Identity Value Sequence&#8220;, identity values are only used once and, in a multi-user system, you should not rely on [...]</description>
		<content:encoded><![CDATA[<p>[...] primary key of the parent table is also an IDENTITY column. As Sebastian Meine points out in &#8220;The Gap In The Identity Value Sequence&#8220;, identity values are only used once and, in a multi-user system, you should not rely on [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Presentation Materials &#8211; Index Internals by 2012-03-10: Index Internals &#8211; SQL Saturday #110, Tampa, Florida &#124; sqlity.net</title>
		<link>http://sqlity.net/en/592/presentation-materials-index-internals/#comment-27</link>
		<dc:creator>2012-03-10: Index Internals &#8211; SQL Saturday #110, Tampa, Florida &#124; sqlity.net</dc:creator>
		<pubDate>Tue, 13 Mar 2012 14:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=592#comment-27</guid>
		<description>[...] TitleIndex Internals - How SQL Server stores and accesses data [...]</description>
		<content:encoded><![CDATA[<p>[...] TitleIndex Internals &#8211; How SQL Server stores and accesses data [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Purge Problems [TSQL Tuesday #027 - The Big Data Valentine’s Edition] by The T-SQL Tuesday #027 Roundup &#171; Voice of the DBA</title>
		<link>http://sqlity.net/en/666/purge-problems-tsql-tuesday-027-the-big-data-valentines-edition/#comment-26</link>
		<dc:creator>The T-SQL Tuesday #027 Roundup &#171; Voice of the DBA</dc:creator>
		<pubDate>Tue, 21 Feb 2012 17:03:48 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=666#comment-26</guid>
		<description>[...] Meine wrote an interesting piece on purging data, and how large data manipulation operations can benefit from [...]</description>
		<content:encoded><![CDATA[<p>[...] Meine wrote an interesting piece on purging data, and how large data manipulation operations can benefit from [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Presentation Materials &#8211; Index Internals by dblumer</title>
		<link>http://sqlity.net/en/592/presentation-materials-index-internals/#comment-25</link>
		<dc:creator>dblumer</dc:creator>
		<pubDate>Thu, 09 Feb 2012 23:26:31 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=592#comment-25</guid>
		<description>Great presentation Sebastian.  Thanks a lot.  Too bad we didn&#039;t have time to wrap up.  I wanted to hear you talk about the Seek vs Scan slide.  Hopefully we can catch up and discuss it a little bit more soon.</description>
		<content:encoded><![CDATA[<p>Great presentation Sebastian.  Thanks a lot.  Too bad we didn&#8217;t have time to wrap up.  I wanted to hear you talk about the Seek vs Scan slide.  Hopefully we can catch up and discuss it a little bit more soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Selecting the entire Database as XML String &#8211; 2 by daniel</title>
		<link>http://sqlity.net/en/626/selecting-the-entire-database-as-xml-string-2/#comment-24</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Mon, 06 Feb 2012 11:31:27 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=626#comment-24</guid>
		<description>Hi Sebastian,

may I ask you to take a look at this: http://stackoverflow.com/questions/9159200/bulk-instert-into-ms-sql-2008r2-from-xml-raw-data

Thanks a lot for your help so far.</description>
		<content:encoded><![CDATA[<p>Hi Sebastian,</p>
<p>may I ask you to take a look at this: <a href="http://stackoverflow.com/questions/9159200/bulk-instert-into-ms-sql-2008r2-from-xml-raw-data" rel="nofollow">http://stackoverflow.com/questions/9159200/bulk-instert-into-ms-sql-2008r2-from-xml-raw-data</a></p>
<p>Thanks a lot for your help so far.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Selecting the entire Database as XML String &#8211; 2 by daniel</title>
		<link>http://sqlity.net/en/626/selecting-the-entire-database-as-xml-string-2/#comment-23</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Mon, 06 Feb 2012 08:45:42 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=626#comment-23</guid>
		<description>Thanks Sebastian, this really works. And I consider your opinion on schemas valuable, so we will add them to the query as in your original solution.</description>
		<content:encoded><![CDATA[<p>Thanks Sebastian, this really works. And I consider your opinion on schemas valuable, so we will add them to the query as in your original solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Selecting the entire Database as XML String &#8211; 2 by Sebastian</title>
		<link>http://sqlity.net/en/626/selecting-the-entire-database-as-xml-string-2/#comment-22</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Fri, 03 Feb 2012 14:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=626#comment-22</guid>
		<description>Yes, you are right. If you want all columns to be attributes (like here) you can use FOR XML RAW. I usually don&#039;t think of it because of it&#039;s restricted flexibility.

To remove the &lt;data&gt; tag, just replace the line containing the SET statement in your query with this one:
&lt;code&gt;SET @cmd = &#039;SELECT [@name],(SELECT data) FROM(&#039;&lt;/code&gt;

On a side note: In SQL Server you should always specify the schema name of all objects. Not doing so can have a lot of unwanted consequences, ranging from performance impacts to hard to find bugs. So if all your tables are in the &quot;dbo&quot; schema you should at least hardcode it in your query, but then you might as well use the OBJECT_SCHEMA_NAME function to be prepared for future additions to your database.</description>
		<content:encoded><![CDATA[<p>Yes, you are right. If you want all columns to be attributes (like here) you can use FOR XML RAW. I usually don&#8217;t think of it because of it&#8217;s restricted flexibility.</p>
<p>To remove the <data> tag, just replace the line containing the SET statement in your query with this one:<br />
<code>SET @cmd = 'SELECT [@name],(SELECT data) FROM('</code></p>
<p>On a side note: In SQL Server you should always specify the schema name of all objects. Not doing so can have a lot of unwanted consequences, ranging from performance impacts to hard to find bugs. So if all your tables are in the &#8220;dbo&#8221; schema you should at least hardcode it in your query, but then you might as well use the OBJECT_SCHEMA_NAME function to be prepared for future additions to your database.</data></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Selecting the entire Database as XML String &#8211; 2 by daniel</title>
		<link>http://sqlity.net/en/626/selecting-the-entire-database-as-xml-string-2/#comment-21</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Thu, 02 Feb 2012 08:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://sqlity.net/en/?p=626#comment-21</guid>
		<description>Hi Sebastian,

I think there might be an easier approach as opposed to getting all the column names into the dynamically constructed query by using for XML RAW. I modified your original SQL query like below (I left out the quotename and schema operations as I do not need them in my implementation).

&lt;code&gt;
DECLARE @cmd NVARCHAR(MAX)

SET @cmd = &#039;SELECT * FROM(&#039;
    + STUFF(
(SELECT &#039; UNION ALL SELECT &#039;&#039;&#039; + name + &#039;&#039;&#039; [@name],&#039; + &#039;(SELECT * FROM &#039;
        + name
        + &#039; FOR XML RAW,BINARY BASE64,TYPE) data&#039;
 FROM sys.tables
 FOR XML PATH,TYPE).value(&#039;.&#039;, &#039;NVARCHAR(MAX)&#039;), 1, 11, &#039;&#039;)
    + &#039;)X FOR XML PATH(&#039;&#039;table&#039;&#039;),TYPE;&#039;
 
EXEC(@cmd)
&lt;/code&gt;

The only problem is that there&#039;s the data node inside all table nodes that I cannot rid of (yeah, my SQL skills are not up to par with yours...)</description>
		<content:encoded><![CDATA[<p>Hi Sebastian,</p>
<p>I think there might be an easier approach as opposed to getting all the column names into the dynamically constructed query by using for XML RAW. I modified your original SQL query like below (I left out the quotename and schema operations as I do not need them in my implementation).</p>
<p><code><br />
DECLARE @cmd NVARCHAR(MAX)</p>
<p>SET @cmd = 'SELECT * FROM('<br />
    + STUFF(<br />
(SELECT ' UNION ALL SELECT ''' + name + ''' [@name],' + '(SELECT * FROM '<br />
        + name<br />
        + ' FOR XML RAW,BINARY BASE64,TYPE) data'<br />
 FROM sys.tables<br />
 FOR XML PATH,TYPE).value('.', 'NVARCHAR(MAX)'), 1, 11, '')<br />
    + ')X FOR XML PATH(''table''),TYPE;'</p>
<p>EXEC(@cmd)<br />
</code></p>
<p>The only problem is that there&#8217;s the data node inside all table nodes that I cannot rid of (yeah, my SQL skills are not up to par with yours&#8230;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

