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 2008 Forums
 Transact-SQL (2008)
 problem adding suffix character

Author  Topic 

susanto1975
Starting Member

1 Post

Posted - 2013-01-21 : 20:09:45
Hi All, i need to your help..
it's my table (t_master)

number Type
1 ZTRW34
2 STRW1
3 STFVRH5

I would need to see the following: (Adding suffix "_OK")
number Type
1 ZTRW34_OK
2 STRW1_OK
3 STFVRH5_OK

i believe somebody can help me...
best thanks..

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2013-01-21 : 20:22:33
SELECT number,[type],[TYPE] + '_OK' as NewType
FROM t_master

or if you actually want to change the values in t_master

UPDATE t_master
SET [TYPE] = [TYPE] + '_OK'

Jim

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -