We help IT Professionals succeed at work.

As I do my update? to remove the *

Hi experts, I just pull data from Oracle to SQL server.
 I have a table with column names at the end of the value of each of the names I have a * for example:
 henry *
 luis *
 Anderson *
 cristian *

 As I do my update? to remove the *
Comment
Watch Question

MisbahSr. Software Engineer
Commented:
update tablename set columname = substring(columname, 1, (len( columname ) -1 ))
Top Expert 2011
Commented:
update yourtable set name = ltrim(substring(name,1,charindex('*',name)-1))
where name like '%*'

if the * truely occurs at the end of the data...

Senior Database Administrator
Commented:
Hi,

If you merely want to remove * that are somewhere in the data

update t
set name = replace( name, '*', '' )
from dbo.SomeTable t

HTH
  David