Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 query

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2010-04-29 : 07:02:39
hi how to change the first word of a column into capitals.is there any function like initcap similat to oracle.if possible give me one query in doing so.

matty
Posting Yak Master

161 Posts

Posted - 2010-04-29 : 07:06:15
upper('a')
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-29 : 07:07:08
quote:
Originally posted by matty

upper('a')


That is not the solution to OP's problem.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-29 : 07:08:09
You shouldn't bother about upper or lower case in your column.
If it is possible then do this in your front end.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2010-04-29 : 07:10:47
from database side is there any query in doing so
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-29 : 07:16:50
[code]declare @test varchar(255)
set @test = 'this is at test'
select @test
select upper(substring(@test,1,charindex(' ',@test)-1))
+substring(@test,charindex(' ',@test),datalength(@test))
[/code]


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -