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)
 Merging two columns of one table

Author  Topic 

Kirun
Yak Posting Veteran

60 Posts

Posted - 2007-11-20 : 06:24:37
I need to merge two columns of a same table into one to show up in a combo box . how can i do it . I am using "&" to concatinate but its giving me error. I thinks its due to concatination of two columns with diffrent datatype. How do i merge them both as string.

like

slect a,b, c & d as expr1

in which d is an integer and c is a string?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-11-20 : 06:27:52
Use CAST() or CONVERT() function to convert integer to string and then concatenate both values using + operator.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -