Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proper case 1

Status
Not open for further replies.

ddfff

MIS
Sep 27, 2002
125
US
Is there a sql function to convert a char field to proper case. First letter of every word to upper case.

Thanks in advance.

Example

Old: detroit

New: Detroit

Old: st. clair shores

New: St. Clair Shores
 
If you are running SQL Server 2000, download and install the Proper Case function from Narayana Vyas Kondreddi's web site.


He also has a Proper Case procedure for SQL Server 7.


If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Thanks.

Where exactly do I need to paste the code for this function to be able to call it from sql statments?

Thanks
 
Hi,

Just run the script shown by Terry in QA(Query Analyser) if u r using SQL Server 2000 in the database u want and after u run u shd be able to use it like any other function like SUM,Count Etc
and it will appear in User defiened functions in Enterprise manager

Sunil
 
Thanks again for the input.

I ran the script in query analyzer and it appeard to complete successfully.

However, it still does not show in user defined functions and when I tried to use it in a select -- the function is still not recognized.

Any possible reasons or something I may be missing.

Thanks.
 
Did you refresh you list of UDFs?
Show us the code you used to call it and we can probably help you with what the correct syntax would be.
 
You have to make sure you add the user prefix when calling the function (e.g., dbo.propercase(lastname) )
 
I think we got it. Did not realize the user defined functions are a specific to the database. I thought they were available for the server globally.

Thanks for your time and effort.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top