Hi smile,
Use REPLACE function.
Refer below query.
SQL
CREATE TABLE Temp
(
[AdmissionNo] [varchar](100) NOT NULL,
[ Date] [varchar](50) NOT NULL,
)
INSERT INTO Temp VALUES('R-R-001','01-03-23')
INSERT INTO Temp VALUES('R-R-002','01-03-23')
UPDATE Temp SET AdmissionNo =REPLACE(AdmissionNo,'R-R-','S-')
Output
AdmissionNo |
Date |
S-001 |
01-03-2023 |
S-002 |
01-03-2023 |