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 |
kwikwisi
Constraint Violating Yak Guru
283 Posts |
Posted - 2010-12-27 : 03:30:23
|
I jst want to get a sub string from between two delimiting characters Eg. 123-abc-456 , desired string is 'abc'tks. |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-12-27 : 03:44:04
|
is this a column in a tabke or a single variable?select col, substring(col,strtloc+1,endloc-strtloc-1)from(select col, strtloc,endloc=charindex('-',col,strtlod+1)from (select col, strtloc=charindex('-',col) from tbl) a) a==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-12-27 : 08:22:22
|
If dot is not part of data, you can useselect parsename(replace(col,'-','.'),2) from tableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|