Offer : Register on ola cabs with refferal code Z53BQY and get 200 rupee to your wallet instantly
Join Dotnetcodes is online Discussion Forum for Software professionals . It lets you find friends around the world and Create professional network that share similar interests as you. Get help on ur projects by industry specialists. Also get answers to all ur technical/placement related querries.Get an edge over others.
Already MemberClick here to login MVC Interview Questions Answers Interview Questions
Get Started Developing for Android Apps with Eclipse Articles
Whats New in ASP.NET 4.0 Part 2 Articles
.Net framework 4.0 Interview Questions Answers Interview Questions
SQL server reporting services Interview Questions (SSRS) part 1 Articles
SharePoint 2010 interview Questions Answers Interview Questions
Html5 interview questions and answers Interview Questions
Serial Number in SSRS Articles
How to Print a Crystal Report direct to printer Articles
Explaining SDLC -System Development Life Cycle Articles
Populate or bind Dropdownlist in using Jquery and Json Articles
Sql Server Database Backup and Restore through C# Source Codes
ASP .Net Page Life cycle Articles
ASP.NET MVC Overview Interview Questions
Difference between Encapsulation and Abstraction Interview Questions
Submit Articles | More Articles..

Function to Convert Text String to Title Case – Proper Case

Posted By: Jaishree On:3/6/2013 11:23:44 PM in:Source Codes Category:Sql Server Hits:878
User Defined Function in SQL Serevr to Convert Text String to Title Case – Proper Case

User Defined Function in SQL Serevr to Convert Text String to Title Case – Proper Case

CREATE FUNCTION udf_Convert_TitleCase (@InputString VARCHAR(4000) )
DECLARE @OutputString VARCHAR(255)
SET @OutputString = LOWER(@InputString)
SET @Index = 2
SET @OutputString =
STUFF(@OutputString, 1, 1,UPPER(SUBSTRING(@InputString,1,1)))
WHILE @Index <= LEN(@InputString)
SET @Char = SUBSTRING(@InputString, @Index, 1)
IF @Char IN (' ', ';', ':', '!', '?', ',', '.', '_', '-', '/', '&','''','(')
IF @Index + 1 <= LEN(@InputString)
IF @Char != ''''
UPPER(SUBSTRING(@InputString, @Index + 1, 1)) != 'S'
SET @OutputString =
STUFF(@OutputString, @Index + 1, 1,UPPER(SUBSTRING(@InputString, @Index + 1, 1)))
SET @Index = @Index + 1
RETURN ISNULL(@OutputString,'')

comments powered by Disqus
User Profile
Sr. Engineer
Delhi , India
Email :You must Log In to access the contact details.
Latest Post from :Jaishree
Function to Convert Text String to Title Case – Proper Case
View: 878 | Submitted on: 3/6/2013 11:23:44 PM
Uploading an image directly into the database and retreive in the PictureBox control in Windows Forms Application
View: 823 | Submitted on: 9/21/2012 3:05:29 AM
Oracle Interview Questions part 2
View: 849 | Submitted on: 1/7/2011 3:45:40 AM
Oracle Interview Questions part 1
View: 618 | Submitted on: 1/7/2011 3:43:40 AM
Oracle Interview Questions
View: 721 | Submitted on: 1/7/2011 3:36:49 AM
Submit Articles | All Post of This User..

All rights reserved to dotnetcodes. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
Best viewed at 1024 x 768 resolution with Internet Explorer 5.0 or Mozila Firefox 3.5 or Google Crome and higher