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
 General SQL Server Forums
 New to SQL Server Programming
 query

Author  Topic 

gagani
Posting Yak Master

112 Posts

Posted - 2012-05-11 : 11:20:41
table

HOME OFFICE
LETTING AGENTS
RESIDENTIAL AREAS

I need a query to get the output as
Home Office
Letting Agents
Residential Areas

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-05-11 : 11:43:41
Not sure what you mean. This?
SELECT
[HOME OFFICE],
[LETTING AGENTS],
[RESIDENTIAL AREAS]
FROM
YourTable;
Or, if all the columns are of the same/similar data type, then may be this?
SELECT [HOME OFFICE] FROM YourTable UNION ALL
SELECT [LETTING AGENTS] FROM YourTable UNION ALL
SELECT [RESIDENTIAL AREAS] FROM YourTable;
Go to Top of Page

gagani
Posting Yak Master

112 Posts

Posted - 2012-05-11 : 11:54:15
I have a table with capital letters for each column value. Without
changing that table, I need a query to get the output in such way that
if there is one word in the column, then the starting letter should be
capital and the rest should be in small letters.
if there are two words, then starting letter of each word should be caps
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-05-11 : 12:19:27
Take a look at these links to see if those will help you:
http://beyondrelational.com/modules/2/blogs/70/posts/10901/tsql-initcap-function-convert-a-string-to-proper-case.aspx
http://weblogs.sqlteam.com/jeffs/archive/2007/03/09/60131.aspx
Go to Top of Page
   

- Advertisement -