SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Query to get only First Letter in UPPER CASE
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vision.v1
Yak Posting Veteran

71 Posts

Posted - 09/27/2013 :  13:39:38  Show Profile  Reply with Quote
Hi,

In my database all names are stored in Upper Case like below:

SMITH,
JHON,
STEVEN

but i need to get the result like below, if all ther letter are in UPPERCASE when we are importing data to a third party tool getting error, so i need the result like below:

Smith
Jhon
Steven

Please advise..

James K
Flowing Fount of Yak Knowledge

3546 Posts

Posted - 09/27/2013 :  15:13:50  Show Profile  Reply with Quote
STUFF(YourColumn,2,LEN(YourColumn),LOWER(SUBSTRING(YourColumn,2,LEN(YourColumn))))
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 09/28/2013 :  05:49:42  Show Profile  Reply with Quote
STUFF(LOWER(Field),1,1,LEFT(Field,1))

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

VeeranjaneyuluAnnapureddy
Posting Yak Master

India
164 Posts

Posted - 09/29/2013 :  01:06:14  Show Profile  Reply with Quote

Select Stuff(Lower(UPPER(YourColumn)),1,1,Left(UPPER(YourColumn),1))From TableName

veeranjaneyulu
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000