-
Change a char in a char(20) globally in a table
Sample record has '1213v1333'
I need to change 'v' to 'x' through all records.
How do I do that?
Thanks
-
if it is sql server use REPLACE function.
create table ree (name char(20))
go
insert into ree select '1213v1333'
insert into ree select '233v78773'
insert into ree select '1213v6778'
insert into ree select '44313v5633'
insert into ree select '4443v1433'
go
--before updating
select * from ree
--Update
update ree set name = replace(name,'v','x')
--After updating
select * from ree
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|