<?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; Simple Example of Cursor</title>
	<atom:link href="http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ankit Goel</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-57664</link>
		<dc:creator>Ankit Goel</dc:creator>
		<pubDate>Tue, 17 Nov 2009 12:30:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-57664</guid>
		<description>Sumardika...

You should fetch first record before entering in to the loop. Next fetch statement should come after select @PhoneNum = @PhoneNum + (@telno + ‘ ‘) statement

That should return you good results</description>
		<content:encoded><![CDATA[<p>Sumardika&#8230;</p>
<p>You should fetch first record before entering in to the loop. Next fetch statement should come after select @PhoneNum = @PhoneNum + (@telno + ‘ ‘) statement</p>
<p>That should return you good results</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sachitha</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-56488</link>
		<dc:creator>Sachitha</dc:creator>
		<pubDate>Wed, 07 Oct 2009 06:52:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-56488</guid>
		<description>very simple and good example for beginners...thanks a lot.....</description>
		<content:encoded><![CDATA[<p>very simple and good example for beginners&#8230;thanks a lot&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-56288</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Wed, 30 Sep 2009 19:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-56288</guid>
		<description>@mahendra

Just add an aggregate to salid. Because it is always one value, using an aggregate won&#039;t change anything. Also, the HAVING can be just COUNT(*). No reason to mention salary, the GROUP BY on salary takes care of that:

WITH
	salary(salid, salary)
AS
	(
	 SELECT 1, 10 UNION ALL
	 SELECT 2, 20 UNION ALL
	 SELECT 3, 40 UNION ALL
	 SELECT 4, 10 UNION ALL
	 SELECT 5, 50 UNION ALL
	 SELECT 6, 40
	)
SELECT
		MAX(salid),
		salary
FROM
		salary
GROUP BY
		salary
HAVING
		COUNT(*) = 1</description>
		<content:encoded><![CDATA[<p>@mahendra</p>
<p>Just add an aggregate to salid. Because it is always one value, using an aggregate won&#8217;t change anything. Also, the HAVING can be just COUNT(*). No reason to mention salary, the GROUP BY on salary takes care of that:</p>
<p>WITH<br />
	salary(salid, salary)<br />
AS<br />
	(<br />
	 SELECT 1, 10 UNION ALL<br />
	 SELECT 2, 20 UNION ALL<br />
	 SELECT 3, 40 UNION ALL<br />
	 SELECT 4, 10 UNION ALL<br />
	 SELECT 5, 50 UNION ALL<br />
	 SELECT 6, 40<br />
	)<br />
SELECT<br />
		MAX(salid),<br />
		salary<br />
FROM<br />
		salary<br />
GROUP BY<br />
		salary<br />
HAVING<br />
		COUNT(*) = 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mahendra singh</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-56276</link>
		<dc:creator>mahendra singh</dc:creator>
		<pubDate>Wed, 30 Sep 2009 13:46:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-56276</guid>
		<description>prasad

hi

i have s salary table

salid salary

1 10
2 20
3 40
4 10
5 50
6 40

i want out put like this
id salary

2 20
4 50
note:-no need to display repated values in above column 10 and 40 is repated values except repated values i wnt to display remaining values

plz help me


HERE is Query

select * from test where val in (select val from test group by val having count(val)=1)</description>
		<content:encoded><![CDATA[<p>prasad</p>
<p>hi</p>
<p>i have s salary table</p>
<p>salid salary</p>
<p>1 10<br />
2 20<br />
3 40<br />
4 10<br />
5 50<br />
6 40</p>
<p>i want out put like this<br />
id salary</p>
<p>2 20<br />
4 50<br />
note:-no need to display repated values in above column 10 and 40 is repated values except repated values i wnt to display remaining values</p>
<p>plz help me</p>
<p>HERE is Query</p>
<p>select * from test where val in (select val from test group by val having count(val)=1)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mahesh</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-56183</link>
		<dc:creator>Mahesh</dc:creator>
		<pubDate>Sat, 26 Sep 2009 06:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-56183</guid>
		<description>Thanks its GR8</description>
		<content:encoded><![CDATA[<p>Thanks its GR8</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ghnanambal.K</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-54462</link>
		<dc:creator>Ghnanambal.K</dc:creator>
		<pubDate>Wed, 05 Aug 2009 09:16:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-54462</guid>
		<description>HI</description>
		<content:encoded><![CDATA[<p>HI</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SathishKumar</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-54454</link>
		<dc:creator>SathishKumar</dc:creator>
		<pubDate>Wed, 05 Aug 2009 06:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-54454</guid>
		<description>I have doubt in pivot concept
I created one table and select that table using pivot concept
but i cant use where condition,i need only I semester result or II semester result but its show in both semester if we are use where condition mean its should be work but i cant do where condition....any one help me....


CREATE TABLE TestOne
(
	CourseName varchar(100),
	Semester varchar(100),
	StudentNumber varchar(100),
	StudentName varchar(100),
	Date datetime,
	AttendanceStatus varchar(20)
) 

insert into TestOne values(&#039;BA&#039;,&#039;I Semester&#039;,&#039;BC985233&#039;,&#039;RAJA&#039;,&#039;2009-07-08&#039;,&#039;P&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;I Semester&#039;,&#039;AC232233&#039;,&#039;Sathish&#039;,&#039;2009-07-08&#039;,&#039;A&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;I Semester&#039;,&#039;BC985233&#039;,&#039;RAJA&#039;,&#039;2009-07-10&#039;,&#039;A&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;I Semester&#039;,&#039;AC232233&#039;,&#039;Sathish&#039;,&#039;2009-07-10&#039;,&#039;P&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;I Semester&#039;,&#039;BC985233&#039;,&#039;RAJA&#039;,&#039;2009-07-15&#039;,&#039;P&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;I Semester&#039;,&#039;AC232233&#039;,&#039;Sathish&#039;,&#039;2009-07-15&#039;,&#039;A&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;I Semester&#039;,&#039;BC985233&#039;,&#039;RAJA&#039;,&#039;2009-07-20&#039;,&#039;P&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;I Semester&#039;,&#039;AC232233&#039;,&#039;Sathish&#039;,&#039;2009-07-20&#039;,&#039;P&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;II Semester&#039;,&#039;BC985233&#039;,&#039;RAJA&#039;,&#039;2009-07-25&#039;,&#039;A&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;II Semester&#039;,&#039;AC232233&#039;,&#039;Sathish&#039;,&#039;2009-07-25&#039;,&#039;P&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;II Semester&#039;,&#039;BC985233&#039;,&#039;RAJA&#039;,&#039;2009-07-30&#039;,&#039;P&#039;)
insert into TestOne values(&#039;BA&#039;,&#039;II Semester&#039;,&#039;AC232233&#039;,&#039;Sathish&#039;,&#039;2009-07-30&#039;,&#039;A&#039;)


DECLARE @listCol VARCHAR(2000)
DECLARE @query VARCHAR(4000)
DECLARE @query1 VARCHAR(4000)

SELECT @listCol = STUFF(( SELECT DISTINCT &#039;],[&#039; + convert(nvarchar,date,111) FROM TestOne
ORDER BY &#039;],[&#039; + convert(nvarchar,date,111) FOR XML PATH(&#039;&#039;)), 1, 2, &#039;&#039;) + &#039;]&#039;

--print @listCol
SET @query =
&#039;SELECT * FROM
(SELECT StudentName,StudentNumber,CourseName,Semester,[Date]
, AttendanceStatus
FROM TestOne) src
PIVOT (max(AttendanceStatus) FOR [Date]
IN (&#039;+@listCol+&#039;)) AS pvt&#039;

EXECUTE (@query)</description>
		<content:encoded><![CDATA[<p>I have doubt in pivot concept<br />
I created one table and select that table using pivot concept<br />
but i cant use where condition,i need only I semester result or II semester result but its show in both semester if we are use where condition mean its should be work but i cant do where condition&#8230;.any one help me&#8230;.</p>
<p>CREATE TABLE TestOne<br />
(<br />
	CourseName varchar(100),<br />
	Semester varchar(100),<br />
	StudentNumber varchar(100),<br />
	StudentName varchar(100),<br />
	Date datetime,<br />
	AttendanceStatus varchar(20)<br />
) </p>
<p>insert into TestOne values(&#8216;BA&#8217;,'I Semester&#8217;,'BC985233&#8242;,&#8217;RAJA&#8217;,'2009-07-08&#8242;,&#8217;P')<br />
insert into TestOne values(&#8216;BA&#8217;,'I Semester&#8217;,'AC232233&#8242;,&#8217;Sathish&#8217;,'2009-07-08&#8242;,&#8217;A')<br />
insert into TestOne values(&#8216;BA&#8217;,'I Semester&#8217;,'BC985233&#8242;,&#8217;RAJA&#8217;,'2009-07-10&#8242;,&#8217;A')<br />
insert into TestOne values(&#8216;BA&#8217;,'I Semester&#8217;,'AC232233&#8242;,&#8217;Sathish&#8217;,'2009-07-10&#8242;,&#8217;P')<br />
insert into TestOne values(&#8216;BA&#8217;,'I Semester&#8217;,'BC985233&#8242;,&#8217;RAJA&#8217;,'2009-07-15&#8242;,&#8217;P')<br />
insert into TestOne values(&#8216;BA&#8217;,'I Semester&#8217;,'AC232233&#8242;,&#8217;Sathish&#8217;,'2009-07-15&#8242;,&#8217;A')<br />
insert into TestOne values(&#8216;BA&#8217;,'I Semester&#8217;,'BC985233&#8242;,&#8217;RAJA&#8217;,'2009-07-20&#8242;,&#8217;P')<br />
insert into TestOne values(&#8216;BA&#8217;,'I Semester&#8217;,'AC232233&#8242;,&#8217;Sathish&#8217;,'2009-07-20&#8242;,&#8217;P')<br />
insert into TestOne values(&#8216;BA&#8217;,'II Semester&#8217;,'BC985233&#8242;,&#8217;RAJA&#8217;,'2009-07-25&#8242;,&#8217;A')<br />
insert into TestOne values(&#8216;BA&#8217;,'II Semester&#8217;,'AC232233&#8242;,&#8217;Sathish&#8217;,'2009-07-25&#8242;,&#8217;P')<br />
insert into TestOne values(&#8216;BA&#8217;,'II Semester&#8217;,'BC985233&#8242;,&#8217;RAJA&#8217;,'2009-07-30&#8242;,&#8217;P')<br />
insert into TestOne values(&#8216;BA&#8217;,'II Semester&#8217;,'AC232233&#8242;,&#8217;Sathish&#8217;,'2009-07-30&#8242;,&#8217;A')</p>
<p>DECLARE @listCol VARCHAR(2000)<br />
DECLARE @query VARCHAR(4000)<br />
DECLARE @query1 VARCHAR(4000)</p>
<p>SELECT @listCol = STUFF(( SELECT DISTINCT &#8216;],[' + convert(nvarchar,date,111) FROM TestOne<br />
ORDER BY '],[' + convert(nvarchar,date,111) FOR XML PATH('')), 1, 2, '') + ']&#8216;</p>
<p>&#8211;print @listCol<br />
SET @query =<br />
&#8216;SELECT * FROM<br />
(SELECT StudentName,StudentNumber,CourseName,Semester,[Date]<br />
, AttendanceStatus<br />
FROM TestOne) src<br />
PIVOT (max(AttendanceStatus) FOR [Date]<br />
IN (&#8216;+@listCol+&#8217;)) AS pvt&#8217;</p>
<p>EXECUTE (@query)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-54106</link>
		<dc:creator>Imran Mohammed</dc:creator>
		<pubDate>Sun, 26 Jul 2009 17:54:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-54106</guid>
		<description>@Subramaniam

Sir, Please have some patience. You asked the same question at-least 5 times in this blog. I understand this issue could be urgent but please ask your question once and have patience, your question will be answered.

Now My Response to your question. 

There is no straight forward method to do this insert a new column between two existing column in a table. 

Method1: Use SQL Server Management Studio (SSMS, SQL Server 2005). 
Step1: Go to Object Explorer
Step2: Expand Databases
Step3: Expand Tables
Step4: Right Click Table Name Click Design /Modify.
Step5: Right Click on Table structure and click Insert Column, Check the position where you want to Insert.
Step6: Click Save.

Note: Before you Save, make sure you check, Generate Change Script (This will be one of the option in SSMS header). This will show you SQL Script that SQL Server will execute to make this change. 

Method2: Drop and recreate table, In the new table script add the new column. 


~ IM.</description>
		<content:encoded><![CDATA[<p>@Subramaniam</p>
<p>Sir, Please have some patience. You asked the same question at-least 5 times in this blog. I understand this issue could be urgent but please ask your question once and have patience, your question will be answered.</p>
<p>Now My Response to your question. </p>
<p>There is no straight forward method to do this insert a new column between two existing column in a table. </p>
<p>Method1: Use SQL Server Management Studio (SSMS, SQL Server 2005).<br />
Step1: Go to Object Explorer<br />
Step2: Expand Databases<br />
Step3: Expand Tables<br />
Step4: Right Click Table Name Click Design /Modify.<br />
Step5: Right Click on Table structure and click Insert Column, Check the position where you want to Insert.<br />
Step6: Click Save.</p>
<p>Note: Before you Save, make sure you check, Generate Change Script (This will be one of the option in SSMS header). This will show you SQL Script that SQL Server will execute to make this change. </p>
<p>Method2: Drop and recreate table, In the new table script add the new column. </p>
<p>~ IM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: subramaniam</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-54103</link>
		<dc:creator>subramaniam</dc:creator>
		<pubDate>Sun, 26 Jul 2009 16:57:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-54103</guid>
		<description>How can i insert a new column between two columns?
using SQL SERVER 2005</description>
		<content:encoded><![CDATA[<p>How can i insert a new column between two columns?<br />
using SQL SERVER 2005</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: subramaniam</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-54102</link>
		<dc:creator>subramaniam</dc:creator>
		<pubDate>Sun, 26 Jul 2009 16:56:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-54102</guid>
		<description>How can i insert a new column between twl column?
using SQL SERVER 2005

please tel me the query

thank u</description>
		<content:encoded><![CDATA[<p>How can i insert a new column between twl column?<br />
using SQL SERVER 2005</p>
<p>please tel me the query</p>
<p>thank u</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: subramaniam</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-54101</link>
		<dc:creator>subramaniam</dc:creator>
		<pubDate>Sun, 26 Jul 2009 16:48:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-54101</guid>
		<description>Give me the example for cursor
what is the use of cursor?

thank u</description>
		<content:encoded><![CDATA[<p>Give me the example for cursor<br />
what is the use of cursor?</p>
<p>thank u</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Cohen</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-53520</link>
		<dc:creator>Steven Cohen</dc:creator>
		<pubDate>Tue, 07 Jul 2009 16:44:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-53520</guid>
		<description>In regards to Mir&#039;s question (I know, a long time ago, but it might help someone), I have created a complete working sample:

SET NOCOUNT ON;

DECLARE @OrderComments Table(OrderNo INT, Comment VARCHAR(256))
INSERT INTO @OrderComments VALUES(101, &#039;Hello,&#039;)
INSERT INTO @OrderComments VALUES(101, &#039;my&#039;)
INSERT INTO @OrderComments VALUES(101, &#039;friends.&#039;)
INSERT INTO @OrderComments VALUES(102, &#039;This is another&#039;)
INSERT INTO @OrderComments VALUES(102, &#039;comment&#039;)


DECLARE @orderNo INT
DECLARE @comments VARCHAR(4000)
DECLARE @comment VARCHAR(256)

DECLARE orderList CURSOR FOR
    SELECT DISTINCT OrderNo FROM @OrderComments

OPEN orderList
FETCH NEXT FROM orderList INTO @orderNo

WHILE @@FETCH_STATUS = 0
BEGIN
    SET @comments = &#039;&#039;
    DECLARE commentList CURSOR FOR
        SELECT Comment FROM @OrderComments WHERE OrderNo = @orderNo

    OPEN commentList
    FETCH NEXT FROM commentList INTO @comment
    
    WHILE @@FETCH_STATUS = 0
    BEGIN
        SET @comments = @comments + &#039; &#039; + @comment
        FETCH NEXT FROM commentList INTO @comment
    END

    PRINT CAST(@orderNo AS VARCHAR(50)) + &#039;: &#039; + @comments

    CLOSE commentList
    DEALLOCATE commentList

    FETCH NEXT FROM orderList INTO @orderNo
END

CLOSE orderList
DEALLOCATE orderList</description>
		<content:encoded><![CDATA[<p>In regards to Mir&#8217;s question (I know, a long time ago, but it might help someone), I have created a complete working sample:</p>
<p>SET NOCOUNT ON;</p>
<p>DECLARE @OrderComments Table(OrderNo INT, Comment VARCHAR(256))<br />
INSERT INTO @OrderComments VALUES(101, &#8216;Hello,&#8217;)<br />
INSERT INTO @OrderComments VALUES(101, &#8216;my&#8217;)<br />
INSERT INTO @OrderComments VALUES(101, &#8216;friends.&#8217;)<br />
INSERT INTO @OrderComments VALUES(102, &#8216;This is another&#8217;)<br />
INSERT INTO @OrderComments VALUES(102, &#8216;comment&#8217;)</p>
<p>DECLARE @orderNo INT<br />
DECLARE @comments VARCHAR(4000)<br />
DECLARE @comment VARCHAR(256)</p>
<p>DECLARE orderList CURSOR FOR<br />
    SELECT DISTINCT OrderNo FROM @OrderComments</p>
<p>OPEN orderList<br />
FETCH NEXT FROM orderList INTO @orderNo</p>
<p>WHILE @@FETCH_STATUS = 0<br />
BEGIN<br />
    SET @comments = &#8221;<br />
    DECLARE commentList CURSOR FOR<br />
        SELECT Comment FROM @OrderComments WHERE OrderNo = @orderNo</p>
<p>    OPEN commentList<br />
    FETCH NEXT FROM commentList INTO @comment</p>
<p>    WHILE @@FETCH_STATUS = 0<br />
    BEGIN<br />
        SET @comments = @comments + &#8216; &#8216; + @comment<br />
        FETCH NEXT FROM commentList INTO @comment<br />
    END</p>
<p>    PRINT CAST(@orderNo AS VARCHAR(50)) + &#8216;: &#8216; + @comments</p>
<p>    CLOSE commentList<br />
    DEALLOCATE commentList</p>
<p>    FETCH NEXT FROM orderList INTO @orderNo<br />
END</p>
<p>CLOSE orderList<br />
DEALLOCATE orderList</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ghnanambal.K</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-50563</link>
		<dc:creator>Ghnanambal.K</dc:creator>
		<pubDate>Mon, 06 Apr 2009 14:21:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-50563</guid>
		<description>I NEED SIMPLE CURSOR FUNTION TO CONCAT THE TWO FEILDS</description>
		<content:encoded><![CDATA[<p>I NEED SIMPLE CURSOR FUNTION TO CONCAT THE TWO FEILDS</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blass</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-50547</link>
		<dc:creator>Blass</dc:creator>
		<pubDate>Mon, 06 Apr 2009 08:39:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-50547</guid>
		<description>Hi prasad,

Here is another solution to your gender table question (2005v required):

select identity (int,1,1) id, s
into #t
from (
	select &#039;m&#039; s union all
	select &#039;m&#039; s union all
	select &#039;f&#039; s union all
	select &#039;m&#039; s union all
	select &#039;f&#039; s union all		
	select &#039;f&#039; s union all
	select &#039;m&#039; s) t;

with cte as (select id, id - row_number() over (partition by s order by id) diff, s from #t)
select s from cte group by diff, s order by max(id);

drop table #t;

Regards,
Blass</description>
		<content:encoded><![CDATA[<p>Hi prasad,</p>
<p>Here is another solution to your gender table question (2005v required):</p>
<p>select identity (int,1,1) id, s<br />
into #t<br />
from (<br />
	select &#8216;m&#8217; s union all<br />
	select &#8216;m&#8217; s union all<br />
	select &#8216;f&#8217; s union all<br />
	select &#8216;m&#8217; s union all<br />
	select &#8216;f&#8217; s union all<br />
	select &#8216;f&#8217; s union all<br />
	select &#8216;m&#8217; s) t;</p>
<p>with cte as (select id, id &#8211; row_number() over (partition by s order by id) diff, s from #t)<br />
select s from cte group by diff, s order by max(id);</p>
<p>drop table #t;</p>
<p>Regards,<br />
Blass</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blass</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-50546</link>
		<dc:creator>Blass</dc:creator>
		<pubDate>Mon, 06 Apr 2009 08:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-50546</guid>
		<description>Hi prasad,

Here is another solution to your gender table question (2005v required):

select identity (int,1,1) id, s
into #t
from (
	select &#039;m&#039; s union all
	select &#039;m&#039; s union all
	select &#039;f&#039; s union all
	select &#039;m&#039; s union all
	select &#039;f&#039; s union all
	select &#039;f&#039; s union all
	select &#039;m&#039; s) t;

with cte as (select id - row_number() over (partition by s order by id) diff, s from #t)
select s from cte group by diff, s;

drop table #t;


Regards,
Blass</description>
		<content:encoded><![CDATA[<p>Hi prasad,</p>
<p>Here is another solution to your gender table question (2005v required):</p>
<p>select identity (int,1,1) id, s<br />
into #t<br />
from (<br />
	select &#8216;m&#8217; s union all<br />
	select &#8216;m&#8217; s union all<br />
	select &#8216;f&#8217; s union all<br />
	select &#8216;m&#8217; s union all<br />
	select &#8216;f&#8217; s union all<br />
	select &#8216;f&#8217; s union all<br />
	select &#8216;m&#8217; s) t;</p>
<p>with cte as (select id &#8211; row_number() over (partition by s order by id) diff, s from #t)<br />
select s from cte group by diff, s;</p>
<p>drop table #t;</p>
<p>Regards,<br />
Blass</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vijay</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-50542</link>
		<dc:creator>vijay</dc:creator>
		<pubDate>Mon, 06 Apr 2009 07:13:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-50542</guid>
		<description>I have one table (LPODTL) with two columns(part_no,indt_no) 

saved records structure is

part_no     indt_no
P1              i1,i2

i want output like part_no+indt_no means(p1i1 in one row,p1i2 in second row )

plz help.</description>
		<content:encoded><![CDATA[<p>I have one table (LPODTL) with two columns(part_no,indt_no) </p>
<p>saved records structure is</p>
<p>part_no     indt_no<br />
P1              i1,i2</p>
<p>i want output like part_no+indt_no means(p1i1 in one row,p1i2 in second row )</p>
<p>plz help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mir</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-49514</link>
		<dc:creator>Mir</dc:creator>
		<pubDate>Thu, 19 Mar 2009 21:05:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-49514</guid>
		<description>I have a table that has a column with comments in it. These comments are associated with a orderNo. For example:

Orderno                Comment

101                       Hello,
101                       How are you

I would like to have the comments appear on a single row. For example:

Orderno               Comment
101                      Hello, How are you

Please Help!</description>
		<content:encoded><![CDATA[<p>I have a table that has a column with comments in it. These comments are associated with a orderNo. For example:</p>
<p>Orderno                Comment</p>
<p>101                       Hello,<br />
101                       How are you</p>
<p>I would like to have the comments appear on a single row. For example:</p>
<p>Orderno               Comment<br />
101                      Hello, How are you</p>
<p>Please Help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: syed m jawad</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-48994</link>
		<dc:creator>syed m jawad</dc:creator>
		<pubDate>Sat, 14 Mar 2009 09:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-48994</guid>
		<description>Dear helper

please help me

i want to find out 

max(sum(stMarks))

but it not work, please help me

Regards

jawad</description>
		<content:encoded><![CDATA[<p>Dear helper</p>
<p>please help me</p>
<p>i want to find out </p>
<p>max(sum(stMarks))</p>
<p>but it not work, please help me</p>
<p>Regards</p>
<p>jawad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: G.Srinivasan</title>
		<link>http://blog.sqlauthority.com/2007/01/01/sql-server-simple-example-of-cursor/#comment-48030</link>
		<dc:creator>G.Srinivasan</dc:creator>
		<pubDate>Wed, 04 Mar 2009 15:04:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-48030</guid>
		<description>HI Friend Thank You very much, very useful for me and company friends,

Thank you very much

by
G.Srinivasan, M.Sc(cs)</description>
		<content:encoded><![CDATA[<p>HI Friend Thank You very much, very useful for me and company friends,</p>
<p>Thank you very much</p>
<p>by<br />
G.Srinivasan, M.Sc(cs)</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/01/01/sql-server-simple-example-of-cursor/#comment-47179</link>
		<dc:creator>SQLAuthority News - Best Articles on SQLAuthority.com Journey to SQL Authority with Pinal Dave</dc:creator>
		<pubDate>Tue, 24 Feb 2009 12:06:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/01/01/simple-example-of-cursor/#comment-47179</guid>
		<description>[...] SQL SERVER - Simple Example of Cursor [...]</description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER &#8211; Simple Example of Cursor [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
