<?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; Dynamic Case Statement &#8211; FIX : ERROR 156 : Incorrect syntax near the keyword</title>
	<atom:link href="http://blog.sqlauthority.com/2008/02/28/sql-server-dynamic-case-statement-fix-error-156-incorrect-syntax-near-the-keyword/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/02/28/sql-server-dynamic-case-statement-fix-error-156-incorrect-syntax-near-the-keyword/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #018 &#124; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2008/02/28/sql-server-dynamic-case-statement-fix-error-156-incorrect-syntax-near-the-keyword/#comment-430056</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #018 &#124; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 02 Mar 2013 01:30:48 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=521#comment-430056</guid>
		<description><![CDATA[[...] Dynamic Case Statement – FIX : ERROR 156 : Incorrect syntax near the keyword This blog post explains a quick resolutions about how to resolve the issue when there is Dynamic Case Statement in the query. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Dynamic Case Statement – FIX : ERROR 156 : Incorrect syntax near the keyword This blog post explains a quick resolutions about how to resolve the issue when there is Dynamic Case Statement in the query. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sujatha</title>
		<link>http://blog.sqlauthority.com/2008/02/28/sql-server-dynamic-case-statement-fix-error-156-incorrect-syntax-near-the-keyword/#comment-216659</link>
		<dc:creator><![CDATA[sujatha]]></dc:creator>
		<pubDate>Tue, 13 Dec 2011 08:39:07 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=521#comment-216659</guid>
		<description><![CDATA[Given question: supplier supplying only part s1 

Supplier    part
p1                           s1        
p1                           s2        
p2                           s2        
p3                           s3        
p3                           s4        
p4                           s1        
p4                           s3        
p5                           s5       

Answer which i did as show below.
I have created table ‘test’ and the query as shown below-

select supplier
from test 
where part=&#039;s1&#039;and supplier not in (select supplier
from test 
where part!=&#039;s1&#039;)

i want the still optimised answer.plz anyone help me.]]></description>
		<content:encoded><![CDATA[<p>Given question: supplier supplying only part s1 </p>
<p>Supplier    part<br />
p1                           s1<br />
p1                           s2<br />
p2                           s2<br />
p3                           s3<br />
p3                           s4<br />
p4                           s1<br />
p4                           s3<br />
p5                           s5       </p>
<p>Answer which i did as show below.<br />
I have created table ‘test’ and the query as shown below-</p>
<p>select supplier<br />
from test<br />
where part=&#8217;s1&#8242;and supplier not in (select supplier<br />
from test<br />
where part!=&#8217;s1&#8242;)</p>
<p>i want the still optimised answer.plz anyone help me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/02/28/sql-server-dynamic-case-statement-fix-error-156-incorrect-syntax-near-the-keyword/#comment-85202</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Wed, 25 Aug 2010 08:58:07 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=521#comment-85202</guid>
		<description><![CDATA[Remove Values keyword and Opening and Closing bracket of the SELECT statement]]></description>
		<content:encoded><![CDATA[<p>Remove Values keyword and Opening and Closing bracket of the SELECT statement</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/02/28/sql-server-dynamic-case-statement-fix-error-156-incorrect-syntax-near-the-keyword/#comment-85200</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Wed, 25 Aug 2010 08:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=521#comment-85200</guid>
		<description><![CDATA[Can you post the full code you used?]]></description>
		<content:encoded><![CDATA[<p>Can you post the full code you used?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tushar</title>
		<link>http://blog.sqlauthority.com/2008/02/28/sql-server-dynamic-case-statement-fix-error-156-incorrect-syntax-near-the-keyword/#comment-85172</link>
		<dc:creator><![CDATA[tushar]]></dc:creator>
		<pubDate>Wed, 25 Aug 2010 03:39:42 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=521#comment-85172</guid>
		<description><![CDATA[DESC my_contact;

ERROR:-
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword &#039;DESC&#039;.]]></description>
		<content:encoded><![CDATA[<p>DESC my_contact;</p>
<p>ERROR:-<br />
Msg 156, Level 15, State 1, Line 1<br />
Incorrect syntax near the keyword &#8216;DESC&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adars</title>
		<link>http://blog.sqlauthority.com/2008/02/28/sql-server-dynamic-case-statement-fix-error-156-incorrect-syntax-near-the-keyword/#comment-61636</link>
		<dc:creator><![CDATA[Adars]]></dc:creator>
		<pubDate>Tue, 23 Feb 2010 12:02:16 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=521#comment-61636</guid>
		<description><![CDATA[while trying to execute the following code
INSERT INTO [OPNSDATA].[dbo].[OPSDATA]
           ([POD_NO]
           ,[IOMNO]
           
           ,[IOMDT]
           
           ,[IOMDESTN]
           
           ,[IOMWT]
           )
     VALUES
           ( SELECT TRACKBASE.DBO.IOMMAST.POD_NO,TRACKBASE.DBO.IOMMAST.IOMNO,TRACKBASE.DBO.IOMMAST.SYS_DT AS IOMDT,TRACKBASE.DBO.IOMMAST.[WEIGHT] AS IOMWT,TRACKBASE.DBO.IOMMAST.DESTN AS IOMDESTN FROM TRACKBASE.DBO.IOMMAST  WHERE TRACKBASE.DBO.IOMMAST.SYS_DT=DATEADD(&quot;DAY&quot;,-2,CONVERT(SMALLDATETIME,CONVERT( VARCHAR(12) ,GETDATE(),101))) AND TRACKBASE.DBO.IOMMAST.POD_NO LIKE &#039;BLR%&#039;)
GO
i got the error as follows
Msg 156, Level 15, State 1, Line 12
Incorrect syntax near the keyword &#039;SELECT&#039;.
Msg 102, Level 15, State 1, Line 12
Incorrect syntax near &#039;)&#039;.

can you help me 

thanks]]></description>
		<content:encoded><![CDATA[<p>while trying to execute the following code<br />
INSERT INTO [OPNSDATA].[dbo].[OPSDATA]<br />
           ([POD_NO]<br />
           ,[IOMNO]</p>
<p>           ,[IOMDT]</p>
<p>           ,[IOMDESTN]</p>
<p>           ,[IOMWT]<br />
           )<br />
     VALUES<br />
           ( SELECT TRACKBASE.DBO.IOMMAST.POD_NO,TRACKBASE.DBO.IOMMAST.IOMNO,TRACKBASE.DBO.IOMMAST.SYS_DT AS IOMDT,TRACKBASE.DBO.IOMMAST.[WEIGHT] AS IOMWT,TRACKBASE.DBO.IOMMAST.DESTN AS IOMDESTN FROM TRACKBASE.DBO.IOMMAST  WHERE TRACKBASE.DBO.IOMMAST.SYS_DT=DATEADD(&#8220;DAY&#8221;,-2,CONVERT(SMALLDATETIME,CONVERT( VARCHAR(12) ,GETDATE(),101))) AND TRACKBASE.DBO.IOMMAST.POD_NO LIKE &#8216;BLR%&#8217;)<br />
GO<br />
i got the error as follows<br />
Msg 156, Level 15, State 1, Line 12<br />
Incorrect syntax near the keyword &#8216;SELECT&#8217;.<br />
Msg 102, Level 15, State 1, Line 12<br />
Incorrect syntax near &#8216;)&#8217;.</p>
<p>can you help me </p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allan Svelmoe Hansen</title>
		<link>http://blog.sqlauthority.com/2008/02/28/sql-server-dynamic-case-statement-fix-error-156-incorrect-syntax-near-the-keyword/#comment-34042</link>
		<dc:creator><![CDATA[Allan Svelmoe Hansen]]></dc:creator>
		<pubDate>Thu, 28 Feb 2008 06:43:43 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=521#comment-34042</guid>
		<description><![CDATA[Simply send the integer value (1 for asc and -1 for desc) down to the query instead of a text string, then you can use that value to multiply without ever using a case in the order by.]]></description>
		<content:encoded><![CDATA[<p>Simply send the integer value (1 for asc and -1 for desc) down to the query instead of a text string, then you can use that value to multiply without ever using a case in the order by.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
