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
 Remove this character from the beginning of text

Author  Topic 

SQLapprentice
Starting Member

29 Posts

Posted - 2012-02-15 : 05:41:57
´++

I did a load infile into text column and I need to replace it. It's the first character of text column

SQLapprentice
Starting Member

29 Posts

Posted - 2012-02-15 : 06:05:45
figured it out

update version SET text = REPLACE(text, substring(texto,1,2),'');
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-15 : 09:23:06
quote:
Originally posted by SQLapprentice

figured it out

update version SET text = REPLACE(text, substring(texto,1,2),'');


this will replace first 2 characters to '' regardless of whether its ++ or something else

if ++ is only what concerns you just add a filter at least like

update version SET text = REPLACE(text, substring(texto,1,2),'')
where text like '++%'



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-03-17 : 13:54:14
or

update version SET text = substring(text,3,len(text))
where text like '++%'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -