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)
 Concatnate

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-03-17 : 17:04:52
How do i get the below results for concatenate.


Table
-----

Id name
-- ----
1 sam
2 John

Output

1,Sam
2,John

mfemenel
Professor Frink

1421 Posts

Posted - 2009-03-17 : 17:06:47
select cast(id as varchar(3)) + ',' + [name] from table

Mike
"oh, that monkey is going to pay"
Go to Top of Page
   

- Advertisement -