SQL Server update query replace last character of a value -


i have column name source has values jbinfotech_clc_4120_20160128.

how update last character 7. there hundreds of records want update @ same time. these records:

select * [jbinfotech].[dbo].[leads] id <= 985 order id desc; 

this permanently updating record not select.

you can try this,

declare @table table   (      col1 varchar(100)   )  insert @table values      ('abcdef123'),             ('jbinfotech_clc_4120_20160128')  select *   @table  update @table set    col1 = stuff(col1, len(col1), 1, '7')  select *   @table  

Comments