Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Kindly send me the query to change the first letter to upper case in sql server 2005.

Thanks,

Viswanathan.m
Posted
Updated 14-Sep-21 4:59am

 
Share this answer
 
Comments
Viswanthan.M. 16-Aug-11 2:21am    
Hi,, we can't use initcap function in sql server 2005
SQL
Declare @FirstChatCapital nvarchar(20)
Set @FirstChatCapital = 'codeproject'
Select upper(substring(@FirstChatCapital,1,1))+lower(substring(@FirstChatCapital,2,len(@FirstChatCapital))) 


You can replace your table column name with @FirstChatCapital variable.
 
Share this answer
 
v2
UPDATE table_name SET
column_Name= UPPER(substring(column_Name,1,1))+lower(substring(column_name,2,20)))
 
Share this answer
 
Comments
Richard Deeming 14-Sep-21 11:09am    
So basically what Solution 2 said, over ten years ago?

If you're going to resurrect an ancient question to post a new solution, make sure you have read the existing solutions, and that you are adding something new to the discussion. Otherwise, stick to answering new questions.

Posting what is essentially a copy of someone else's answer could be seen as plagiarism, which is not tolerated here, and would result in you being banned from the site.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900