﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Jeff Moden / Article Discussions / Article Discussions by Author </title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 24 May 2012 12:12:32 GMT</lastBuildDate><ttl>20</ttl><item><title>Tally OH!  An Improved SQL 8K “CSV Splitter” Function</title><link>http://www.sqlservercentral.com/Forums/Topic1101315-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Tally+Table/72993/"&gt;Tally OH!  An Improved SQL 8K “CSV Splitter” Function&lt;/A&gt;[/B]</description><pubDate>Sun, 01 May 2011 09:02:31 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Generating Test Data: Part 1 - Generating Random Integers and Floats</title><link>http://www.sqlservercentral.com/Forums/Topic1272409-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Data+Generation/87901/"&gt;Generating Test Data: Part 1 - Generating Random Integers and Floats&lt;/A&gt;[/B]</description><pubDate>Sun, 25 Mar 2012 17:26:34 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Generating Test Data: Part 2 - Generating Sequential and Random Dates</title><link>http://www.sqlservercentral.com/Forums/Topic1289524-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Test+Data/88964/"&gt;Generating Test Data: Part 2 - Generating Sequential and Random Dates&lt;/A&gt;[/B]</description><pubDate>Tue, 24 Apr 2012 21:40:48 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Hidden RBAR: Counting with Recursive CTE's</title><link>http://www.sqlservercentral.com/Forums/Topic1155832-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/74118/"&gt;Hidden RBAR: Counting with Recursive CTE's&lt;/A&gt;[/B]</description><pubDate>Mon, 08 Aug 2011 00:13:18 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Find Customers Who Bought &amp;quot;A&amp;quot; and &amp;quot;B&amp;quot; But Not &amp;quot;C&amp;quot; (SQL Spackle)</title><link>http://www.sqlservercentral.com/Forums/Topic1274832-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/88244/"&gt;Find Customers Who Bought &amp;quot;A&amp;quot; and &amp;quot;B&amp;quot; But Not &amp;quot;C&amp;quot; (SQL Spackle)&lt;/A&gt;[/B]</description><pubDate>Wed, 28 Mar 2012 21:51:33 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Formatting Dates with 3 Character Months (SQL Spackle)</title><link>http://www.sqlservercentral.com/Forums/Topic1050485-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/formatting/72066/"&gt;Formatting Dates with 3 Character Months (SQL Spackle)&lt;/A&gt;[/B]</description><pubDate>Wed, 19 Jan 2011 21:37:57 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Calculating Work Days</title><link>http://www.sqlservercentral.com/Forums/Topic153606-203-1.aspx</link><description>&lt;P&gt;&lt;SPAN id=Showtread1_ThreadRepeater__ctl1_lblFullMessage&gt;Comments posted to this topic are about the content posted at &lt;A href="http://www.sqlservercentral.com/columnists/jmoden/calculatingworkdays.asp"&gt;http://www.sqlservercentral.com/columnists/jmoden/calculatingworkdays.asp&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hey folks... I'm not sure why they decided to repost this old article, but before you make any comments, please realize this...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The name of the article should have been "&lt;FONT color=#1111ff&gt;Calculating &lt;U&gt;WEEKDAYS&lt;/U&gt; in the U.S.A"&lt;/FONT&gt;. &lt;img src='images/emotions/wink.gif' height='20' width='20' border='0' title='Wink' align='absmiddle'&gt;&lt;/STRONG&gt;&lt;/P&gt;</description><pubDate>Tue, 04 Jan 2005 15:19:00 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>REPLACE Multiple Spaces with One</title><link>http://www.sqlservercentral.com/Forums/Topic819042-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/68378/"&gt;REPLACE Multiple Spaces with One&lt;/A&gt;[/B]</description><pubDate>Sat, 14 Nov 2009 12:21:47 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Query Tuning</title><link>http://www.sqlservercentral.com/Forums/Topic1226743-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/Indexes/86916/"&gt;Query Tuning&lt;/A&gt;[/B]</description><pubDate>Mon, 26 Dec 2011 22:16:57 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Why doesn’t ISNUMERIC work correctly? (SQL Spackle)</title><link>http://www.sqlservercentral.com/Forums/Topic1028368-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/IsNumeric/71512/"&gt;Why doesn’t ISNUMERIC work correctly? (SQL Spackle)&lt;/A&gt;[/B]</description><pubDate>Tue, 30 Nov 2010 21:00:58 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Group Islands of Contiguous Dates (SQL Spackle)</title><link>http://www.sqlservercentral.com/Forums/Topic1031000-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/71550/"&gt;Group Islands of Contiguous Dates (SQL Spackle)&lt;/A&gt;[/B]</description><pubDate>Mon, 06 Dec 2010 21:36:25 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Solving the &amp;quot;Running Total&amp;quot; &amp; &amp;quot;Ordinal Rank&amp;quot; Problems (Rewritten)</title><link>http://www.sqlservercentral.com/Forums/Topic802558-203-1.aspx</link><description>Comments posted to this topic are about the item [url=http://www.sqlservercentral.com/articles/T-SQL/68467/][b]Solving the "Running Total" &amp; "Ordinal Rank" Problems (Rewritten)[/b][/url]Comments posted to this topic are about the item [url=http://www.sqlservercentral.com/articles/T-SQL/68467/][b]Solving the "Running Total" &amp; "Ordinal Rank" Problems (Rewritten)[/b][/url]*** NOTICE *** This article is in the process of (hopefully) the final "rewrite".  *** NOTICE *** In the meantime, you'll be very interested to know that Paul White and Tom Thompson have a method of error checking that not only checks for errors virtually without any additional overhead, the method they came up with also helps further guarantee the correct sort order for the updates.  You can find an example of the coded method at the following URL which will lead to you a post very late in this thread...[url]http://www.sqlservercentral.com/Forums/FindPost981258.aspx[/url]</description><pubDate>Wed, 14 Oct 2009 02:11:35 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>The &amp;quot;Numbers&amp;quot; or &amp;quot;Tally&amp;quot; Table: What it is and how it replaces a loop.</title><link>http://www.sqlservercentral.com/Forums/Topic496042-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/TSQL/62867/"&gt;The &amp;quot;Numbers&amp;quot; or &amp;quot;Tally&amp;quot; Table: What it is and how it replaces a loop.&lt;/A&gt;[/B]</description><pubDate>Tue, 06 May 2008 21:42:30 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Displaying Sorted Hierarchies (SQL Spackle)</title><link>http://www.sqlservercentral.com/Forums/Topic1075989-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/72503/"&gt;Displaying Sorted Hierarchies (SQL Spackle)&lt;/A&gt;[/B]</description><pubDate>Wed, 09 Mar 2011 21:44:03 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Create a Tally or Numbers Table</title><link>http://www.sqlservercentral.com/Forums/Topic467926-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Advanced+SQL/62486/"&gt;Create a Tally or Numbers Table&lt;/A&gt;[/B]</description><pubDate>Wed, 12 Mar 2008 01:15:04 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Cross Tabs and Pivots, Part 1 – Converting Rows to Columns</title><link>http://www.sqlservercentral.com/Forums/Topic554742-203-1.aspx</link><description>Comments posted to this topic are about the item [url=http://www.sqlservercentral.com/articles/T-SQL/63681/][font="Arial Black"]Cross Tabs and Pivots, Part 1 – Converting Rows to Columns[/font][/url]Folks, Part 2 of this article can be found at the following link...[url=http://www.sqlservercentral.com/articles/cross+tab/65048/][font="Arial Black"](click here) Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs[/font][/url]</description><pubDate>Mon, 18 Aug 2008 22:59:44 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>hi new project help with sql and creating a free money style script</title><link>http://www.sqlservercentral.com/Forums/Topic1189326-203-1.aspx</link><description>i have a user database setup and have uploaded the sql structure to jnet2012.0fees.net/attachmentsi would like the sql to be so that another table called balance is there and php files to add a text box input of the amount and also a selection box so i can select who balance is edited once these simple funtions are in place i can extend it later for when a visitor logs in or visits a page there session logged in user name will be used to add x amount of free credits to there acount balancelater will be free things as gifts and also gifts to send to other users etc.this script i feel will be very usefull for all web masters wanting new guests to sitesmy skills are very limited and get stuck on syntax etc any one help me at all would be very happy to share files from my site jnet2012.0fees.net and i can share parts from that if you like it and thanks to those who just want to helpi want pages made in php 1 showing all balences in desc ordera page so i can have a input box for the username or from a list somehow with amount edit input box that shows whats currently in that users balenceon a 3rd page i need an example page that when it is included with another php file (index for example) it will give that user a little extra points for using the site for examplethen from this i can add multipliers etc and add bits for games etcany one help me with this i have ideas but no nothing of real syntax when using php and mysql together in this way and want to add to my current database sql is in attachments and hopefully in the same place as users id tables can be added a field called balancei have got this far but cant get passed making these 3 simple pages as described above these are the most important as involves php</description><pubDate>Wed, 12 Oct 2011 10:57:53 GMT</pubDate><dc:creator>jamied_uk</dc:creator></item><item><title>Forum Etiquette: How to post data/code on a forum to get the best help</title><link>http://www.sqlservercentral.com/Forums/Topic426135-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Best+Practices/61537/"&gt;Forum Etiquette: How to post data/code on a forum to get the best help&lt;/A&gt;[/B]</description><pubDate>Mon, 26 Nov 2007 21:22:52 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>And the LINQ version looks like...</title><link>http://www.sqlservercentral.com/Forums/Topic1077072-203-1.aspx</link><description>After coding the RBAR logic to populate a complex TreeView, I come across this article and say "Where were you a week ago?". I like what I have read, but have no idea how to do this in LINQ and the project rule is that all data access must be done in LINQ. Any translators out there?</description><pubDate>Fri, 11 Mar 2011 11:00:19 GMT</pubDate><dc:creator>rhj4</dc:creator></item><item><title>Hidden Formatting Troubles with STR() (SQL Spackle)</title><link>http://www.sqlservercentral.com/Forums/Topic1034868-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/71565/"&gt;Hidden Formatting Troubles with STR() (SQL Spackle)&lt;/A&gt;[/B]</description><pubDate>Tue, 14 Dec 2010 20:30:36 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Expand this to multiple concurrent hierarchies and effective date sensitive?</title><link>http://www.sqlservercentral.com/Forums/Topic1076333-203-1.aspx</link><description>How can I apply this model with a couple of extended properties.Using an employee/manager model, I have added a 'hierarchy code' to both entities and an effective date. How could I incorporate these two additional properties to the process in this discussion?</description><pubDate>Thu, 10 Mar 2011 09:12:40 GMT</pubDate><dc:creator>jerry-995988</dc:creator></item><item><title>Need help on Linked server Transactions cauasing Optimistic concurrency and to avoid DTS failure</title><link>http://www.sqlservercentral.com/Forums/Topic1071842-203-1.aspx</link><description>1. My DTS is failing often with the below err: OLE DB provider 'MSDAORA' reported an error. [SQLSTATE 42000] (Error 7399)   [SQLSTATE 01000] (Error 7312)   [SQLSTATE 01000] (Error 7312)  OLE DB error trace [OLE/DB Provider 'MSDAORA' [b]IOpenRowset::OpenRowset returned 0x80004005[/b]:   ]. [SQLSTATE 01000] (Error 7300).  The step failed. 20110302 02:30:09 AM [WUPRDDB01A] 2. Executed as user: MYDB\MYLogon. Agent insert  start [SQLSTATE 01000] (Message 0)  School insert  end [SQLSTATE 01000] (Message 0)  School Update  end [SQLSTATE 01000] (Message 0)  School Status change  end [SQLSTATE 01000] (Message 0)  Notice order end [SQLSTATE 01000] (Message 0)  OLD_STUDENTS deleted [SQLSTATE 01000] (Message 0)  OLE DB provider 'MSDAORA' could not UPDATE table '[LNKSVRMY]..[CITY].[STUDENT]'. The rowset was using optimistic concurrency and the value of a column has been changed after the containing row was last fetched or resynchronized. [SQLSTATE 42000] (Error 7343)   [SQLSTATE 01000] (Error 7312)  OLE DB error trace [OLE/DB Provider 'MSDAORA' IRowsetChange::SetData returned 0x80040e38:  The rowset was using optimistic concurrency and the value of a column has been changed after the containing row was last fetched or resynchronized.]. [SQLSTATE 01000] (Error 7300).  The step failed.20110301 04:48:01 PM [PRODUCTION01A]I am using SQL Server 2000 and trying to Modify the data at Oracle 10G server. In production the STUDENT is being updated with multiple sources (apart from Sql 2000, it is being updated by some applications as well). We have kept all updates/inserts for that particular table under transactions.I have simulated the scenario by opening two parellel transaction on the same table.and found the error.Session #1SET XACT_ABORT ONBEGIN DISTRIBUTED TRANSACTIONUPDATE  LNKSVRMY..CITY.STUDENTSET ACTIVE = 0 WHERE STD_ID = '57FH'OutPut:(1 row(s) affected)Session #2SET XACT_ABORT ONBEGIN DISTRIBUTED TRANSACTIONUPDATE LNKSVRMY..CITY.STUDENTSET ACTIVE = 0 WHERE  STD_ID = '57FH'OutPut: No result since other transaction is openSEssion #1Will execute the COMMITSession#2i got the below concurrency problemServer: Msg 7343, Level 16, State 4, Line 3OLE DB provider 'MSDAORA' could not UPDATE table '[LNKSVRMY]..[CITY].[STUDENT]'. The rowset was using optimistic concurrency and the value of a column has been changed after the containing row was last fetched or resynchronized.[OLE/DB provider returned message: Row cannot be located for updating. Some values may have been changed since it was last read.]OLE DB error trace [OLE/DB Provider 'MSDAORA' IRowsetChange::SetData returned 0x80040e38:  The rowset was using optimistic concurrency and the value of a column has been changed after the containing row was last fetched or resynchronized.].On the other hand if the Session #1 run for long without transaction been commited i get the err:Server: Msg 7399, Level 16, State 1, Line 3OLE DB provider 'MSDAORA' reported an error.  [OLE/DB provider returned message: ORA-02049: timeout: distributed transaction waiting for lock]OLE DB error trace [OLE/DB Provider 'MSDAORA' IRowsetChange::SetData returned 0x80004005:   ].Plese let me know any of you faced/know this error and found the solution.</description><pubDate>Wed, 02 Mar 2011 05:25:48 GMT</pubDate><dc:creator>kiran.konankal</dc:creator></item><item><title>Hidden RBAR: Triangular Joins</title><link>http://www.sqlservercentral.com/Forums/Topic430004-203-1.aspx</link><description>Comments posted to this topic are about the item [B] [url=http://www.sqlservercentral.com/articles/T-SQL/61539/]Hidden RBAR: Triangular Joins[/url] [/B]First, thank you for reading my article and any feedback that you my post... good or bad.  The exchange of ideas is how we all learn and your feedback is certainly a part of that process and is most welcome.Second, there's a bit of a bug in the forum software... when they republish an article, it changes the date on the article.  This article was originally published on 2007-12-06.  The webmaster has been advised and there's nothing they can do about it for the moment.  I appologize if this leads to any confusion and I'd still like to hear your comments even if you may have seen the article before.Third, Yes, I actually did do a followup on the running total problem.  The link that follows will take you there, but be advised... although the high speed update method that uses an index hint does always work, don't use the method as a substitute for an ORDER BY on SELECTs.  I'm working on a rewrite of the article that explains why and hope to have it out soon.  Also be advised that if you don't follow the instructions that I've given to a "T", you could get wrong answers... of course, that would be true of any code, wouldn't it?  Here's the link...[url]http://www.sqlservercentral.com/articles/Advanced+Querying/61716/[/url]Last, but not least, if you're interested in other articles that I've written, please see the following link... I'd be very interested in your comments on those, as well[url]http://www.sqlservercentral.com/Authors/Articles/Jeff_Moden/80567/[/url]Thanks again, folks.  I'm humbled by all of your responses and the time you spent writing them up.</description><pubDate>Wed, 05 Dec 2007 21:17:49 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Dissecting SQL Server Execution Plans</title><link>http://www.sqlservercentral.com/Forums/Topic835574-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Book+Reviews/69019/"&gt;Dissecting SQL Server Execution Plans&lt;/A&gt;[/B]</description><pubDate>Thu, 17 Dec 2009 00:05:19 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Display More Than 8000 Characters (SQL Spackle)</title><link>http://www.sqlservercentral.com/Forums/Topic1054372-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/72129/"&gt;Display More Than 8000 Characters (SQL Spackle)&lt;/A&gt;[/B]</description><pubDate>Wed, 26 Jan 2011 21:26:31 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Sorting Months By Number (SQL Spackle)</title><link>http://www.sqlservercentral.com/Forums/Topic1020369-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/71511/"&gt;Sorting Months By Number (SQL Spackle)&lt;/A&gt;[/B]</description><pubDate>Sat, 13 Nov 2010 13:33:20 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Passing Parameters as (almost) 1, 2, and 3 Dimensional Arrays</title><link>http://www.sqlservercentral.com/Forums/Topic499145-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/63003/"&gt;Passing Parameters as (almost) 1, 2, and 3 Dimensional Arrays&lt;/A&gt;[/B]</description><pubDate>Mon, 12 May 2008 14:50:22 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Extract of tally data base to excel</title><link>http://www.sqlservercentral.com/Forums/Topic977333-203-1.aspx</link><description>We would like to use data available in tally table for generation of reports in excel. Please letus know if any way we can extract data from tally data baseThanks,Regards.C.Madhavan</description><pubDate>Mon, 30 Aug 2010 08:06:55 GMT</pubDate><dc:creator>chakramadhavan</dc:creator></item><item><title>Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs</title><link>http://www.sqlservercentral.com/Forums/Topic612568-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/cross+tab/65048/"&gt;Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs&lt;/A&gt;[/B]</description><pubDate>Tue, 02 Dec 2008 22:15:33 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>Stored Procedures</title><link>http://www.sqlservercentral.com/Forums/Topic941298-203-1.aspx</link><description>hi all'i am new in sql server database.In my new project mostly i have to work in stored procedure side.This is support project,i have to change the stored procedure script..please provide me some tips in stored procedure then i can resolve any problem. Please give me some link of stored procedure.In SP which types of error we get if you guys any idea please share with me.Thanks in Advance.:-)Bharat</description><pubDate>Tue, 22 Jun 2010 12:54:00 GMT</pubDate><dc:creator>singhbharat321</dc:creator></item><item><title>Virtual PM's for Jeff...</title><link>http://www.sqlservercentral.com/Forums/Topic518718-203-1.aspx</link><description>Jeff:  Given that you've found a clever way to block annoying PM's :), I was forced to start this thread so that I could contact you:--======Jeff:  Whats a good Split() type function/method for SQL 2005?  I need to break downa bunch of syscomments entries into lines and I cannot locate the threads of the big tests that you and Matt did on split functions.Thanks,  Barry</description><pubDate>Tue, 17 Jun 2008 20:51:00 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>[HELP] dynamic header in cross tabs</title><link>http://www.sqlservercentral.com/Forums/Topic842524-203-1.aspx</link><description>helo..newbie here...:-Di'm geting mad [img]http://cinta.kaskusradio.com/onion/smiley/stress.gif[/img] [img]http://cinta.kaskusradio.com/onion/smiley/hun.gif[/img]just want to ask :[img]http://img519.imageshack.us/img519/8147/14730416.jpg[/img] please somebody help me..I'll give you guys 'cendol' for better answer :-D:-D, ok.. [img]http://cinta.kaskusradio.com/onion/smiley/2good.gif[/img]thank's b4 for your advice...[img]http://cinta.kaskusradio.com/onion/smiley/bye.gif[/img]</description><pubDate>Tue, 05 Jan 2010 20:29:44 GMT</pubDate><dc:creator>rah_dix</dc:creator></item><item><title>to show row wise data into column wise</title><link>http://www.sqlservercentral.com/Forums/Topic771740-203-1.aspx</link><description>hello,my requirment is that i have 5 rows of data but i want to show it as clomun ex:i have like thisrows        jackmackpeterscottsteve           i need this type columns jack  mack  peter  scott  steve</description><pubDate>Mon, 17 Aug 2009 01:43:11 GMT</pubDate><dc:creator>syed_ahmedzama</dc:creator></item><item><title>running total</title><link>http://www.sqlservercentral.com/Forums/Topic822171-203-1.aspx</link><description>Sir ,   I think that what you have given is to lengthy process i give procedure of my way how i calculate running total -------------------  drop TABLE #data  -- drop temp table if exists   CREATE TABLE #data (myctr INT IDENTITY,chrfolioid VARCHAR(20),numgrandtotal NUMERIC(18,2),running NUMERIC(18,2))INSERT INTO #data (chrfolioid,numgrandtotal)SELECT chrfolioid ,numgrandtotalFROM tARHeader t ORDER BY t.chrFolioID ,t.dteTxnDateDECLARE @ctr AS INT DECLARE @running NUMERIC(18,2)DECLARE @oldfolioid AS VARCHAR(20)SET @ctr = 1SET @running = 0SET @oldfolioid = ''WHILE @ctr &amp;lt;= (SELECT COUNT(*) FROM #data)BEGIN 	IF @oldfolioid &amp;lt;&amp;gt;(SELECT chrfolioid FROM #data WHERE myctr = @ctr)	BEGIN 		SET @running= 0		SET @oldfolioid = (SELECT chrfolioid FROM #data WHERE myctr = @ctr)	END	 	UPDATE #data SET running = (SELECT SUM(numgrandtotal) 	                            from #data 	                            where myctr &amp;lt;= @ctr and chrfolioid = @oldfolioid 	                            GROUP BY chrfolioid ) WHERE myctr = @ctr	SET @ctr = @ctr + 1	PRINT @ctrEND		SELECT * FROM #data ORDER BY 1,2</description><pubDate>Fri, 20 Nov 2009 02:27:38 GMT</pubDate><dc:creator>chandreshgeria</dc:creator></item><item><title>Calculating the throughput time</title><link>http://www.sqlservercentral.com/Forums/Topic786051-203-1.aspx</link><description>Sorry, put it in wrong place.</description><pubDate>Thu, 10 Sep 2009 15:34:20 GMT</pubDate><dc:creator>DungLy</dc:creator></item><item><title>Solving the &amp;quot;Running Total&amp;quot; &amp; &amp;quot;Ordinal Rank&amp;quot; Problems in SS 2k/2k5</title><link>http://www.sqlservercentral.com/Forums/Topic449802-203-1.aspx</link><description>Comments posted to this topic are about the item [url=http://www.sqlservercentral.com/articles/Advanced+Querying/61716/][font="Arial Black"]    Solving the "Running Total" &amp; "Ordinal Rank" Problems in SS 2k/2k5  [/font][/url]The new article was published on 10 Nov 2009 and may be found at the following URL...[url]http://www.sqlservercentral.com/articles/T-SQL/68467/[/url]The new article is basically a rewrite of the old article with some fixes and workarounds for some of the things we've encountered in the last year.  A second article is in the works for some of the many uses for the "Quirky Update"... there was just too much in the first article to conveniently fit.</description><pubDate>Wed, 30 Jan 2008 22:21:24 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>More RBAR and &amp;quot;Tuning&amp;quot; UPDATEs</title><link>http://www.sqlservercentral.com/Forums/Topic469155-203-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Performance+Tuning/62278/"&gt;More RBAR and &amp;quot;Tuning&amp;quot; UPDATEs&lt;/A&gt;[/B]</description><pubDate>Thu, 13 Mar 2008 21:26:35 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>pivot table values help</title><link>http://www.sqlservercentral.com/Forums/Topic620753-203-1.aspx</link><description>Hi Jeff,I have a table that has the following values.col1 | col2 | col3 | col41     |  val1| val2 | val3 2     |  val21| val22 | val23 3     |  val31| val32 | val33 what I want is for each col1 entries, I should have the rcol2,col3 and col4 values as  col2_1 col3_1 col4_1 col2_2 col3_2 col4_2 col2_3 col3_3 col4_3val1    |val2 |val3    |val21 |val22 | val23 | val31 | val32 |val33Could you please tell me how to do this? Thanks for your help.-Maria</description><pubDate>Tue, 16 Dec 2008 13:42:44 GMT</pubDate><dc:creator>psmg01</dc:creator></item><item><title>To create dynamic columns in sql 2005</title><link>http://www.sqlservercentral.com/Forums/Topic613533-203-1.aspx</link><description>this is the query i have writtenDECLARE @cols NVARCHAR(2000)SELECT  @cols = COALESCE(@cols + ',[' + Contribution.Contribution + ']',                         '[' + Contribution.Contribution + ']')FROM         dbo.Contribution INNER JOIN                      dbo.ProposalFund ON dbo.Contribution.ContributionId = dbo.ProposalFund.ContributionIdWHERE     (dbo.ProposalFund.Descriptionid = 'cement')DECLARE @query NVARCHAR(4000)SET @query = N'SELECT descriptionid, '+@cols +'FROM(SELECT  t2.ProposalFundid      , t1.Contribution, t2.Amount      , t2.DescriptionidFROM    Contribution AS t1        JOIN ProposalFund AS t2 ON t1.Contributionid = t2.Contributionid) pPIVOT(sum([amount])FOR contribution IN( '+@cols +' )) AS pvtORDER BY Descriptionid;' EXECUTE(@query)and im getting output asdescriptionid     CBV   PARTNERCEMENT          1000     NULLCEMENT           NULL    2000but i want asdescriptionid     CBV   PARTNERCEMENT          1000     2000for this what i have to do???? PLz help meHere CBV and partner are there in contribution tabel and 1000,2000 are amount present in proposalfund tabel and cement is present in description of proposalfund</description><pubDate>Thu, 04 Dec 2008 04:02:05 GMT</pubDate><dc:creator>jsgodson-958000</dc:creator></item><item><title>Converting rows to columns</title><link>http://www.sqlservercentral.com/Forums/Topic582165-203-1.aspx</link><description>Hi,     I have two Columns State and City. When I select them from table, it displays like	 STATE	 CITY 	Connecticut	Hartford	Connecticut 	Stamford	Connecticut	New Haven	Connecticut	BridgeportBut I need them as	 STATE	 CITY1	 CITY2	 CITY3	 CITY4	Connecticut	Hartford  	Stamford 	New Haven	 BridgeportSo that I can use them in my SP. There are many cities for some states.Can you please help me out by using Pivot?</description><pubDate>Tue, 07 Oct 2008 14:07:16 GMT</pubDate><dc:creator>Shree-903371</dc:creator></item></channel></rss>
