October 13, 2008 at 2:31 pm
Hi, I have two fields State and City in one table. When I select I get
STATE CITY
Connecticut Hartford
Connecticut Stamford
Connecticut New Haven
Connecticut Bridgeport
But I need in CSV format, like
ConnecticutHartford, Stamford, New Haven, Bridgeport
There are many cities for some states. At my work place we can’t use dynamic sql. So can anybody suggest me the best way to do it?
October 13, 2008 at 2:38 pm
Instead of posting in TSQL forum I posted here. So please forgive me.
October 13, 2008 at 7:16 pm
See the following for a basic "how to" and some pitfalls to avoid...
http://www.sqlservercentral.com/articles/Test+Data/61572/
... and, in most cases, the biggest pitfall is the task itself. CSV data shouldn't be stored in a database because it violates the first form of nomalization. I can see it, maybe, for file creation.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 14, 2008 at 7:20 am
Hi, I saw that article and tried but its not working. Its giving me null values.
October 14, 2008 at 7:23 pm
Shree (10/14/2008)
Hi, I saw that article and tried but its not working. Its giving me null values.
What did you try? Please post the code and the data you tried with.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply