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
 Adding Suffix Value

Author  Topic 

satheesh
Posting Yak Master

152 Posts

Posted - 2011-04-14 : 07:40:11
Dear all,

I want to add a suffix(old)to the value when i reterving the data.ie.just want to do this in 'select'.I dont want to update all the data.

for ex(existing)
cstid(datatype - int)
100
101
102

expected result
100old
101old
102old

i tried, but i got this error :
Conversion failed when converting the varchar value 'old' to data type int.

Any help reg this would be highly appreciated.Thanks.

Regards,
GS



Ranjit.ileni
Posting Yak Master

183 Posts

Posted - 2011-04-14 : 07:44:47
select convert(varchar(10),cstid)+'old' from yourtable

--Ranjit
Go to Top of Page

raghuveer125
Constraint Violating Yak Guru

285 Posts

Posted - 2011-04-14 : 07:47:20
Try This

select convert(nvarchar , cstid)+'Old' from #t

Raghu' S
Go to Top of Page
   

- Advertisement -