Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Replace last character

Author  Topic 

jimmy2090
Starting Member

26 Posts

Posted - 2014-11-19 : 03:03:00
Hi,
i would like to replace the last character of one column to *
here is the code:


update table set right(column, 1) = '*'
where WORKFLOW_ID = '2'


how to do that?

AASC
Starting Member

24 Posts

Posted - 2014-11-19 : 03:36:51
Use substring function

update dbo.TableName
set ColumnName= substring(ColumnName,1,len(ColumnName)-1 )+'*'
where WORKFLOW_ID = '6'
Go to Top of Page

jimmy2090
Starting Member

26 Posts

Posted - 2014-11-19 : 03:50:32
thanks. it solved.
Go to Top of Page
   

- Advertisement -