Results 1 to 4 of 4

Thread: How to implement the INITCAP equivalent function in SQL Server

  1. #1
    Join Date
    Apr 2009
    Posts
    51

    How to implement the INITCAP equivalent function in SQL Server

    How to implement the INITCAP equivalent function in SQL Server, I would like to convert All Capital Words into Init Cap. ex : 'FUNCTION FN_INITCAP' into 'Function Fn_initcap' This i need to convert the Initials of every string to be in CAPITAL letters, and others in the lower letter.

  2. #2
    Join Date
    Jan 2009
    Posts
    99

    Re: How to implement the INITCAP equivalent function in SQL Server

    As long as there is way to do it..it's OK, For those who are not familiar with this Oracle string function, InitCap is a string function that changes the first letter of a string to uppercase. The remaining letters are made lowercase. I want to use it on select statement
    SELECT Name,addr=fn_initcap(address) from FLATFILE08

  3. #3
    Join Date
    Jan 2006
    Posts
    211

    Re: How to implement the INITCAP equivalent function in SQL Server

    It is sometimes frustrating to know that some of the string functions, For those database developers coming from Oracle and migrating to SQL Server for whatever reason, or any functions for that matter, If you need to implement the INITCAP function then you need to use the following convention, you must do select upper(left(colName, 1)) + substring(colName, 2, len(colName)) as colNamethat you have come accustomed with in Oracle is not available in SQL Server. One of these string functions is the InitCap function.

  4. #4
    Join Date
    Oct 2008
    Posts
    119

    Re: How to implement the INITCAP equivalent function in SQL Server

    If you want to display these data in some kind of report I think there's only UPPER and LOWER I think in T-SQL, and i will suggest you to do this at the client, not at the server. Should be an easy exercise for front-end tools. Since i can find it at oracle INITCAP, i would do the same thing at SQL2K. I mean this looping is more easily done within your programming language.

Similar Threads

  1. c++ equivalent function to the c-function 'sprintf
    By Dilbert in forum Software Development
    Replies: 6
    Last Post: 13-12-2011, 04:03 PM
  2. C# Equivalent Of Javascript's Location.replace() Function?
    By ASHER in forum Software Development
    Replies: 6
    Last Post: 16-05-2010, 01:20 AM
  3. c# function equivalent to gettime function in javascript
    By Omaar in forum Software Development
    Replies: 4
    Last Post: 10-03-2010, 10:44 PM
  4. Replies: 5
    Last Post: 25-02-2010, 03:35 PM
  5. How to implement function like fetch_object and the purpose of using it?
    By Mahendra varma in forum Software Development
    Replies: 3
    Last Post: 05-09-2009, 10:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,649,091.17775 seconds with 16 queries