how to select a field with firstletter as capital and
remaining are small letters

Answers were Sorted based on User's Feedback



how to select a field with firstletter as capital and remaining are small letters..

Answer / priya

SELECT * UPPER(SUBSTRING(<COLUMNNAME>,1,1))
+LOWER(SUBSTRING(<COLUMNNAME>,2,LEN(<COLUMNNAME>))) AS
<SOMENAME> FROM <TABLENAME>

Is This Answer Correct ?    10 Yes 0 No

how to select a field with firstletter as capital and remaining are small letters..

Answer / radhika

SELECT Left(upper(<field_name>) , 1) + substring(lower
(<field_name>, 2, len
(<field_name>))
FROM <table_name>

Is This Answer Correct ?    6 Yes 4 No

how to select a field with firstletter as capital and remaining are small letters..

Answer / dharmendra k dixit

Select Left(Upper((YourColumnName), 1) + Substring(Lower
(YourColumnName),2,Len(YourColumnName))AS UName
From YourTableName

Is This Answer Correct ?    3 Yes 1 No

how to select a field with firstletter as capital and remaining are small letters..

Answer / velmurugan

Select UPper(Left(Company,1)) + Lower(Right(Company,Len
(Company)-1)) From Company

Is This Answer Correct ?    2 Yes 1 No

how to select a field with firstletter as capital and remaining are small letters..

Answer / k.vanitha

CREATE TABLE Employee (NAME VARCHAR(20), SALARY int);

INSERT INTO employee VALUES (
'RAMESH',
9000);
INSERT INTO employee VALUES (
'RAJESH',
10000);

SELECT Left(upper(NAME),1) +
lower(substring(NAME,2,len(NAME))) FROM employee

Is This Answer Correct ?    3 Yes 2 No

how to select a field with firstletter as capital and remaining are small letters..

Answer / bobby

select ascii('a')as a,ascii('z')as z

select ascii('A')as A,ascii('Z')as Z

select * from Table_name where (ascii(<COLUMNNAME>))
between 65 and 90)and
ascii(substring(<COLUMNNAME>,2,1)) between 97 and 122

Is This Answer Correct ?    2 Yes 1 No

how to select a field with firstletter as capital and remaining are small letters..

Answer / amit shukla

select upper(left(h01_first_name,1))
+lower(substring(rtrim(h01_first_name),2,50)) as name from
<table name>

Is This Answer Correct ?    1 Yes 0 No

how to select a field with firstletter as capital and remaining are small letters..

Answer / santosh kumar chhotaray

SELECT UPPER(SUBSTRING(<FieldName>,1,1))+LOWER(SUBSTRING(Name,2,LEN(<FieldName>))) AS
alliasename FROM tablename

Example
--------
SELECT UPPER(SUBSTRING(Name,1,1))+LOWER(SUBSTRING(Name,2,LEN(Name))) AS
name FROM tblInfo

Is This Answer Correct ?    1 Yes 0 No

how to select a field with firstletter as capital and remaining are small letters..

Answer / vidit tyagi

SELECT Left(upper(<field_name>) , 1) + lower(substring
(<field_name>,2,len(<field_name>))) AS SomeName
FROM <table_name>

Is This Answer Correct ?    1 Yes 1 No

how to select a field with firstletter as capital and remaining are small letters..

Answer / venakteswara rao

select upper(<colummn name>,1,1)+substring(lower(<column
name,2,len(<column name>))) as anyname from table name

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Can you name a few encryption mechanisms in sql server?

0 Answers  


Explain about Joins?

0 Answers   Infosys,


What are SSL and TSL protocols?

0 Answers   Wipro,


table:employee EID ENAME MID(manager ids) 101 rama null 102 sita 101 103 siva 101 104 ganesh 103 . . . . . . for 103 ID the manager ID is 101(RAMA) and for 104 manager is SIVA if i give employee id (EID) you have to tell the manager for that EID write query? eample:if i give 102 .The query output should be manager for 102 ID that it should print RAMA as output

7 Answers  


how to select 5 to 7 rows from a table, which contains 10 rows?

21 Answers   IBM,






What is @@Identity in sql?

1 Answers   Cap Gemini,


How to compare the top two records using sql?

0 Answers  


Can select statements be used on views in ms sql server?

0 Answers  


How to list all field names in the result set using mssql_field_name()?

0 Answers  


How to encrypt Strored Procedure in SQL SERVER?

0 Answers  


What is table constraint?

0 Answers  


What does indexation mean?

0 Answers  


Categories