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 |
sachingovekar
Posting Yak Master
101 Posts |
Posted - 2010-02-25 : 03:37:22
|
Hi,I want to extract a part of a string.create table #temp1 (string nvarchar(100))insert into #temp1 ('DGHTYUIW_3425_987601')insert into #temp1 ('DGHT_3412325_9876232201')insert into #temp1 ('SSSSDGHT_3425666666_98897601')MY OUTPUT SHOULD BE:3425_9876013412325_98762322013425666666_98897601all characters after first "_"Regards,Sachin |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-02-25 : 03:52:36
|
[code]select case when charindex('_', string) <> 0 then right(string, len(string) - charindex('_', string)) endfrom #temp1[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
sachingovekar
Posting Yak Master
101 Posts |
Posted - 2010-02-25 : 04:16:22
|
Thanks |
|
|
|
|
|