What is the substitute in sql server of ucfirst in MySql? Please help RRS feed

  • Question

  • Hi.

    Please provide any method to format a name with first letter in Capital. e.g. "Subhadeep Mitra" (you can see the first letter of "Subhadeep" and "Mitra" is in capital.


    Thank you. 

    Friday, August 10, 2007 11:36 AM


  • There is no equivalent. You would need to write your own custom function. The below code will capitalize the first letter of the text. You can probably use it with a custom Split function.


    SELECT UPPER(LEFT(colname,1)) + RIGHT(colname,len(colname) - 1) FROM Table1


    The other option is to handle this in your .NET code, which personally I think is a better idea because it eliminates a database dependent solution.
    Friday, August 10, 2007 1:16 PM