Hi I want to insert char (A) in second index where code start with 's'
Input
s1
s2
s34
Require output
sA1
sA2
sA34
Update T1
set code = ??
where code like 's%'
Hi I want to insert char (A) in second index where code start with 's'
Input
s1
s2
s34
Require output
sA1
sA2
sA34
Update T1
set code = ??
where code like 's%'
Try this:
UPDATE myTable
SET myColumn = 'sA' + RIGHT(myColumn, LEN(myColumn)-1)
WHERE LEFT(LOWER(myColumn), 1) = 's'
Update T1
set code = 'sA' + SUBSTRING(code, 2, LEN(code)-1 )
where code like 's%'
Update MyTable
Set Code = Stuff(Code, 2, 0, 'A')
Where Code Like 's%'