Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 The problem with merging down rows of a sql server table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-03-01 : 08:47:56
Srinivasan Rajesh writes "Assume i have a table that queries the list of serial # from
a table

For a given xPartId
Select SerialList from Serials where Part_Id = xPartId

This will give a list of rows with singl column.

I need a requeirment to append all columns in the rows
to be merged down with a seperator without the usage of cursors
in this query

That is we must first merge rows into columns as in case of
GetRows in Access and we must be able to merge the single row
of multiple coulumns into a single column.

If you know any simple methods please let me know ASAP


Thanx
Rajesh"

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2002-03-01 : 08:47:56
One of these articles should help: http://www.sqlteam.com/SearchResults.asp?SearchTerms=csv. Also check the FAQ.
Go to Top of Page

rajeessh
Starting Member

1 Post

Posted - 2002-03-03 : 00:47:09
I have got a solution for this using the logic inb the query below

declare @varlist nvarchar(4000)
select @varlist = isnull(@varlist + ',','') + convert(nvarchar,s022002) from s022 where s022001 = 5465
select @varlist

This will merge rows with commas

Thanx for all whoi turned up




Go to Top of Page
   

- Advertisement -