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 |
Chris_Kelley
Posting Yak Master
114 Posts |
Posted - 2014-09-10 : 10:11:06
|
c |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2014-09-10 : 10:27:45
|
First please check your data for possible values.For example:Chris KelleyPaul E. NewmanDwayne "The Rock" Douglas Johnson ... Too old to Rock'n'Roll too young to die. |
|
|
Chris_Kelley
Posting Yak Master
114 Posts |
Posted - 2014-09-10 : 10:34:56
|
c |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2014-09-10 : 12:11:46
|
See this example:DECLARE @name VARCHAR(32) = 'Chris Kelley';SELECT LEFT(@name, PATINDEX('% [^ ]%',@name)+1); |
|
|
Chris_Kelley
Posting Yak Master
114 Posts |
Posted - 2014-09-10 : 21:13:46
|
c |
|
|
|
|
|