milani_lucie
asked on
Proper Case - User Defined Function is needed - SQL Server
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.v alue;
inputString = inputString.toLowerCase();
var retValue = "";
var isFirstCharOfWord = 1;
for (var intCount = 0; intCount < inputString.length; intCount++)
{
var ch = inputString.charAt(intCoun t);
if (isFirstCharOfWord == 1)
{
ch = ch.toUpperCase();
}
if (ch == " ")
{
isFirstCharOfWord = 1;
}
else
{
isFirstCharOfWord = 0;
}
retValue = retValue + ch;
}
return retValue;
}
Thanks
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.v
inputString = inputString.toLowerCase();
var retValue = "";
var isFirstCharOfWord = 1;
for (var intCount = 0; intCount < inputString.length; intCount++)
{
var ch = inputString.charAt(intCoun
if (isFirstCharOfWord == 1)
{
ch = ch.toUpperCase();
}
if (ch == " ")
{
isFirstCharOfWord = 1;
}
else
{
isFirstCharOfWord = 0;
}
retValue = retValue + ch;
}
return retValue;
}
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.