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 2005 Forums
 Transact-SQL (2005)
 concatenated values

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-07-03 : 10:49:30
hi iam having some values like
10
20
30
40
50
60

now i want to produce the result as 10,20,30,40,50,60,

like i am having one column patient_id it is having values like that.how can i use then


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-03 : 10:52:47
concatenate records without UDF


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-07-03 : 10:54:19
5. How to put a column into a delimited form?

use northwind
Declare @ColumnList varchar(1000)
SELECT @ColumnList = COALESCE(@ColumnList + ', ', '') + column_name
FROM INFORMATION_SCHEMA.Columns
WHERE table_name = 'Orders'

source: http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-06 : 04:04:18
However, the if it is for display purtpose, it should be done in front end application

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -