Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Programming / SQL / July 2008

Tip: Looking for answers? Try searching our database.

Combine multiple details rows into one column on master (sql 2000)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mttc - 25 Jul 2008 16:08 GMT
I find this at:
http://www.sqlservercurry.com/2008/06/combine-multiple-rows-into-one-row.html

==================================
-- Query to combine multiple rows into one
DECLARE @str VARCHAR(100)
SELECT @str = COALESCE(@str + '|', '') + [Numbers]
FROM #Temp
Print @str

You can also achieve the same result using STUFF

SELECT DISTINCT STUFF( (SELECT '*' + Numbers from #Temp FOR XML
PATH('')),1,1,'') as Numbers FROM #Temp
==================================

the first option is work only for one set of details rows, I need to
do that for many rows, so the second option on above simple is good
for me, but i ned it for SQL2000.
Have some other solution?
Madhivanan - 28 Jul 2008 11:10 GMT
> I find this at:
>  http://www.sqlservercurry.com/2008/06/combine-multiple-rows-into-one-...
[quoted text clipped - 16 lines]
> for me, but i ned it for SQL2000.
> Have some other solution?

http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/rowset-string-concaten
ation-which-method-is-best.aspx

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.