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 |
|
jonasalbert20
Constraint Violating Yak Guru
300 Posts |
Posted - 2005-03-09 : 23:25:15
|
How would you split this...MyString------------------------Aida-LouTesting-lng Split the values by the delimeter "-"result should look like this...MyString1 MyString2-------------------------------------Aida LouTesting lng Want Philippines to become 1st World COuntry? Go for World War 3... |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2005-03-10 : 00:15:00
|
| [code]select substring(MyString,1,charindex('-',MyString)-1) as MyString1, substring(MyString,charindex('-',MyString)+1,len(MyString)) as MyString2from ( select MyString = 'Aida-Lou' union all select MyString = 'Testing-lng' ) aMyString1 MyString2 ----------- ----------- Aida LouTesting lng(2 row(s) affected)[/code]CODO ERGO SUM |
 |
|
|
jonasalbert20
Constraint Violating Yak Guru
300 Posts |
Posted - 2005-03-10 : 00:40:13
|
| tnx michaelWant Philippines to become 1st World COuntry? Go for World War 3... |
 |
|
|
|
|
|