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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Sentence Case Dquery

Author  Topic 

galbrecht
Starting Member

17 Posts

Posted - 2008-02-18 : 14:50:41
Hi

I need to extract data from tables in sentence case. I sthere a way to do this. I would like to have the names of people and the start of a new sentence to Have capitals. The table has "text notes - free text" entered against a dog owner but in alot of cases there is no sentence case.

Is there away to do this

Thanks

Greg

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-02-18 : 18:47:09
sentence case? dog owner?

Can you post an example of the way the text is stored and the way you want it displayed?

Be One with the Optimizer
TG
Go to Top of Page

galbrecht
Starting Member

17 Posts

Posted - 2008-02-19 : 14:47:48
Hey TG

this is the origional format

2542|29 Mar 2004 - waiuku - tyson died 260304 refunded $13.80
2552|05 Dec 2002 - noemaxw - CHEVY DIED ON 04.11.2002. WAS CREATED

This is what I want

2542|29 Mar 2004 - waiuku - Tyson died 260304 refunded $13.80
2552|05 Dec 2002 - noemaxw - Chevey died on 04.11.2002. Was Created

Thanks

Greg
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2008-02-19 : 15:16:44
String functions are pretty clearly laid out in Books Online (have a look at upper, lower, charindex).

The bigger problem that you have is defining your translation rules. How do you know that CHEVY not only should be converted to Upper-C-lower-everything-else, but also should be spelled differently? How do you know what the end of a sentence is (is the 8 in $13.80 a new sentence?)? How do you know when to capitalize words that are not at the start of a sentence (like Created)?

If I were you, I'd simply either leave it the way it is or upper() everything.

Jay
to here knows when
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-02-19 : 15:30:52
couple of related threads:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47718
plus one referenced from within this topic.

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -