S. S. Rawat
S. S. Rawat

Reputation: 6111

change specific data of column

I have a table in which 10 record, now i want to update specific column data, means some part some column data and some not, for example in row 1 i want to change std with standard and other data will remain same, change same thing in all row in a single query. can it will be possible? and remember we cant remove and add cell again because it will change id

id - col1 - col2

1 - A - std abcad
2 - B - std bcddsad
3 - C - std avadsad
4 - A - std abcdsad
5 - B - std bcddsa
6 - C - std avadsad
7 - A - std abcdsd
8 - B - std bcddsds
9 - C - std avadsd

Upvotes: 0

Views: 189

Answers (2)

M.Ali
M.Ali

Reputation: 69514

UPDATE tblName

SET Column .WRITE('Standard',(CHARINDEX('std',Column,1)-1),LEN('std'))

Upvotes: 0

Laurence
Laurence

Reputation: 10976

You can use the replace function for this

Update
    table
Set
    col2 = Replace(col2, 'std', 'standard');

Upvotes: 2

Related Questions