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
 General SQL Server Forums
 New to SQL Server Programming
 how to get concatenated value from stored procedur

Author  Topic 

sweet_777
Starting Member

16 Posts

Posted - 2010-10-21 : 07:26:11
Hi all,

I have a table i.e emptable
emptable: columns are ,1.empid 2.empname 3.emailin emptable email column values are CE,ME
EX:
CREATE PROC SP_TEST
(
@EMPID INT
)
AS
BEGIN
select email from emptable where empid=1
END

using above sp i will get output CE,ME
BUT I NEED TO GET CE+ME LIKE THAThow to do that

Regards
Rama



Thanks & Regards
Sweet_77

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-10-21 : 07:52:15
quote:
Originally posted by sweet_777


Regards
Rama


Thanks & Regards
Sweet_77



Is this question from somewhere else because two times regards with different names.

If the column is having data like 'CE,ME' and you want to return output as 'CD+ME' then you can use replace function.

If your requirement is something different then please post some sample data and expected output.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-21 : 08:21:31
select replace(email,',','+') as email from emptable where empid=1



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

- Advertisement -