Hi,
Can you please provide me "Proper Case" User Defined Function in SQL Server ? Here is the example i have in Java Script. Please convert this into SQL Server.
function ConvertToProperCase()
{
var inputString = document.form1.txtString.value;
inputString = inputString.toLowerCase();
var retValue = "";
var isFirstCharOfWord = 1;
for (var intCount = 0; intCount < inputString.length; intCount++)
{
var ch = inputString.charAt(intCount);
if (isFirstCharOfWord == 1)
{
ch = ch.toUpperCase();
}
if (ch == " ")
{
isFirstCharOfWord = 1;
}
else
{
isFirstCharOfWord = 0;
}
retValue = retValue + ch;
}
return retValue;
}
Thanks
Our community of experts have been thoroughly vetted for their expertise and industry experience.