Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 06-08-2009
Member
 
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.
Reply With Quote
  #2  
Old 06-08-2009
Member
 
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
Reply With Quote
  #3  
Old 06-08-2009
Member
 
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.
Reply With Quote
  #4  
Old 06-08-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to implement the INITCAP equivalent function in SQL Server"
Thread Thread Starter Forum Replies Last Post
c++ equivalent function to the c-function 'sprintf Dilbert Software Development 6 13-12-2011 04:03 PM
C# Equivalent Of Javascript's Location.replace() Function? ASHER Software Development 6 16-05-2010 01:20 AM
c# function equivalent to gettime function in javascript Omaar Software Development 4 10-03-2010 10:44 PM
Help me to implement the partition() function in the C++ language programming Gavyn Software Development 5 25-02-2010 03:35 PM
How to implement function like fetch_object and the purpose of using it? Mahendra varma Software Development 3 05-09-2009 10:10 AM


All times are GMT +5.5. The time now is 10:28 AM.