<?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; Good, Better and Best Programming Techniques</title>
	<atom:link href="http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sun, 12 Feb 2012 09:22:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Swaraj</title>
		<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/#comment-79134</link>
		<dc:creator><![CDATA[Swaraj]]></dc:creator>
		<pubDate>Wed, 07 Jul 2010 22:24:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/28/good-better-and-best-programming-techniques/#comment-79134</guid>
		<description><![CDATA[vivek use other than  express client to open DTA because express edition do not support DTA functnality.

may be your problem will be solved

Swaraj]]></description>
		<content:encoded><![CDATA[<p>vivek use other than  express client to open DTA because express edition do not support DTA functnality.</p>
<p>may be your problem will be solved</p>
<p>Swaraj</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dong</title>
		<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/#comment-77643</link>
		<dc:creator><![CDATA[Dong]]></dc:creator>
		<pubDate>Fri, 25 Jun 2010 12:51:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/28/good-better-and-best-programming-techniques/#comment-77643</guid>
		<description><![CDATA[Thanks for the articles Pinal Dave.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the articles Pinal Dave.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vivek</title>
		<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/#comment-50943</link>
		<dc:creator><![CDATA[Vivek]]></dc:creator>
		<pubDate>Tue, 14 Apr 2009 04:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/28/good-better-and-best-programming-techniques/#comment-50943</guid>
		<description><![CDATA[Hi pinal
  I am a regular reader of your blog.I am facing one problem.When I try to open Database engine tuning adviser,I get an error &quot;database engine tuning adviser do not support Sql express(DATA client)&quot;.Can you please suggest me how can I solve this error.Also can you please told me how &quot;Database engine tuning adviser&quot; is used.


Thanks
Vivek]]></description>
		<content:encoded><![CDATA[<p>Hi pinal<br />
  I am a regular reader of your blog.I am facing one problem.When I try to open Database engine tuning adviser,I get an error &#8220;database engine tuning adviser do not support Sql express(DATA client)&#8221;.Can you please suggest me how can I solve this error.Also can you please told me how &#8220;Database engine tuning adviser&#8221; is used.</p>
<p>Thanks<br />
Vivek</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQLAuthority News - Best Articles on SQLAuthority.com Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/#comment-47203</link>
		<dc:creator><![CDATA[SQLAuthority News - Best Articles on SQLAuthority.com Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Tue, 24 Feb 2009 12:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/28/good-better-and-best-programming-techniques/#comment-47203</guid>
		<description><![CDATA[[...] SQL SERVER - Good, Better and Best Programming Techniques [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER &#8211; Good, Better and Best Programming Techniques [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/#comment-42343</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Wed, 03 Sep 2008 04:16:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/28/good-better-and-best-programming-techniques/#comment-42343</guid>
		<description><![CDATA[Thanks Perry Way for your suggestion.]]></description>
		<content:encoded><![CDATA[<p>Thanks Perry Way for your suggestion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Perry Way</title>
		<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/#comment-42330</link>
		<dc:creator><![CDATA[Perry Way]]></dc:creator>
		<pubDate>Tue, 02 Sep 2008 22:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/28/good-better-and-best-programming-techniques/#comment-42330</guid>
		<description><![CDATA[In reply to jhonatan,

Somehow I think jhonatan is lysdexic and really should be spelled Johnathon, but... what do I know?  I&#039;m just a stupid American.

I solved problem for jhonatan:

--because you don&#039;t use northwind database I 
--have to create table and populate
--first with your data which makes no implicit sense 
CREATE TABLE patientsurveys (
	ps_id INT,
	q1_1 INT,
	q1_2 INT
)

INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (1010101, 1, 19840101)
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (1010101, 2, 19840101)
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (1020232, 1, 19840409)
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (1020256, 1, 19440103)
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (2020225, 2, 19450604)
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (2020232, 1, 19840409)
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (2060354, 2, 19900303)

--this is the form of the query you are asking for, no?
SELECT
	ps_id,
	CONVERT(BIT,CASE WHEN (COUNT(q1_1) &gt; 1) THEN 0 ELSE 1 END) AS STATUS
FROM
	patientsurveys
WHERE
	ps_id IN (SELECT ps_id FROM patientsurveys GROUP BY ps_id HAVING COUNT(*) &gt; 1)
GROUP BY
	ps_id

--be sure to drop this table now, since it makes no sense and 
--serves no usefulness either here now, or in the future
DROP TABLE patientsurveys]]></description>
		<content:encoded><![CDATA[<p>In reply to jhonatan,</p>
<p>Somehow I think jhonatan is lysdexic and really should be spelled Johnathon, but&#8230; what do I know?  I&#8217;m just a stupid American.</p>
<p>I solved problem for jhonatan:</p>
<p>&#8211;because you don&#8217;t use northwind database I<br />
&#8211;have to create table and populate<br />
&#8211;first with your data which makes no implicit sense<br />
CREATE TABLE patientsurveys (<br />
	ps_id INT,<br />
	q1_1 INT,<br />
	q1_2 INT<br />
)</p>
<p>INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (1010101, 1, 19840101)<br />
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (1010101, 2, 19840101)<br />
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (1020232, 1, 19840409)<br />
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (1020256, 1, 19440103)<br />
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (2020225, 2, 19450604)<br />
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (2020232, 1, 19840409)<br />
INSERT INTO patientsurveys (ps_id, q1_1, q1_2) VALUES (2060354, 2, 19900303)</p>
<p>&#8211;this is the form of the query you are asking for, no?<br />
SELECT<br />
	ps_id,<br />
	CONVERT(BIT,CASE WHEN (COUNT(q1_1) &gt; 1) THEN 0 ELSE 1 END) AS STATUS<br />
FROM<br />
	patientsurveys<br />
WHERE<br />
	ps_id IN (SELECT ps_id FROM patientsurveys GROUP BY ps_id HAVING COUNT(*) &gt; 1)<br />
GROUP BY<br />
	ps_id</p>
<p>&#8211;be sure to drop this table now, since it makes no sense and<br />
&#8211;serves no usefulness either here now, or in the future<br />
DROP TABLE patientsurveys</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jhonatan</title>
		<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/#comment-14710</link>
		<dc:creator><![CDATA[jhonatan]]></dc:creator>
		<pubDate>Wed, 03 Oct 2007 22:45:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/28/good-better-and-best-programming-techniques/#comment-14710</guid>
		<description><![CDATA[Good article!

Just a question.

How can I compare 2 rows of a table? Just want to get a boolean value: 1 means the 2 rows are identical; 0 means they&#039;re different.

I&#039;ve tried using &quot;group by&quot;

Query

select ps_id, q1_1,q1_2
from patientsurveys
group by ps_id, q1_1,q1_2

Results

PS_ID         Q1_1    Q1_2
1010101	   1	       19840101
1010101	   2	       19840101
1020232	   1	       19840409
1020256	   1	       19440103
2020225	   2	       19450604
2020232	   1	       19840409
2060354	   2	       19900303

The 2 firsts rows are identical except for Q1_1 column (1 vs 2). I want my query to return just 1 row like this:

PS_ID         STATUS
1010101     0              (means rows are different)

And, the table really has around 200 columns, so is there any way to do this dynamically?


Thanks]]></description>
		<content:encoded><![CDATA[<p>Good article!</p>
<p>Just a question.</p>
<p>How can I compare 2 rows of a table? Just want to get a boolean value: 1 means the 2 rows are identical; 0 means they&#8217;re different.</p>
<p>I&#8217;ve tried using &#8220;group by&#8221;</p>
<p>Query</p>
<p>select ps_id, q1_1,q1_2<br />
from patientsurveys<br />
group by ps_id, q1_1,q1_2</p>
<p>Results</p>
<p>PS_ID         Q1_1    Q1_2<br />
1010101	   1	       19840101<br />
1010101	   2	       19840101<br />
1020232	   1	       19840409<br />
1020256	   1	       19440103<br />
2020225	   2	       19450604<br />
2020232	   1	       19840409<br />
2060354	   2	       19900303</p>
<p>The 2 firsts rows are identical except for Q1_1 column (1 vs 2). I want my query to return just 1 row like this:</p>
<p>PS_ID         STATUS<br />
1010101     0              (means rows are different)</p>
<p>And, the table really has around 200 columns, so is there any way to do this dynamically?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jchen</title>
		<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/#comment-7253</link>
		<dc:creator><![CDATA[Jchen]]></dc:creator>
		<pubDate>Thu, 09 Aug 2007 17:49:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/28/good-better-and-best-programming-techniques/#comment-7253</guid>
		<description><![CDATA[I tried to do DTS export from tool menu using sql 2000. when I click source data: it doesn&#039;t have Microsoft OLE DB provider for sql server.

I didn&#039;t install sp3 for sql server 2000, is this problem or other problems?

Jchen]]></description>
		<content:encoded><![CDATA[<p>I tried to do DTS export from tool menu using sql 2000. when I click source data: it doesn&#8217;t have Microsoft OLE DB provider for sql server.</p>
<p>I didn&#8217;t install sp3 for sql server 2000, is this problem or other problems?</p>
<p>Jchen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL Commandments - Suggestions, Tips, Tricks Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/04/28/sql-server-good-better-and-best-programming-techniques/#comment-1495</link>
		<dc:creator><![CDATA[SQL Commandments - Suggestions, Tips, Tricks Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Sat, 28 Apr 2007 14:07:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/28/good-better-and-best-programming-techniques/#comment-1495</guid>
		<description><![CDATA[[...] Update: Few of this and other new commandments include here: Good, Better and Best Programming Techniques [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Update: Few of this and other new commandments include here: Good, Better and Best Programming Techniques [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

