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.
| Author |
Topic |
|
Mondeo
Constraint Violating Yak Guru
287 Posts |
Posted - 2008-02-20 : 10:22:43
|
| I've got a few thousand rows in table and I need to manipulate the data one of the fields.Each record starts like this <h1>Some Text</h1>I need to remove this string from the start of all records, is there a simple way of doing it, obviously you could do it in vb using substring or Regex but in pure SQL ?Thanks |
|
|
jdaman
Constraint Violating Yak Guru
354 Posts |
Posted - 2008-02-20 : 10:43:53
|
| Look up t-sql string manipulation commands LEFT, RIGHT, SUBSTRING, and REPLACE in bol. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-20 : 10:47:49
|
SELECT SUBSTRING(Col1, 5, LEN(Col1) - 9)FROM Table1WHERE Col1 LIKE '<h1>%</h1>' E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-20 : 11:06:56
|
| orSELECT replace(replace(Col1,'<h1>',''),'</h1>','')FROM Table1WHERE Col1 LIKE '<h1>%</h1>'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|