Menu

Showing posts with label Capital Letter in ms sql server 2005 and 2008. Show all posts
Showing posts with label Capital Letter in ms sql server 2005 and 2008. Show all posts

Sunday, 2 February 2014

Adding New Word Before Column Name With Capital Letter in MS SQL Server



EmployeeID
EmployeeName
EmployeeMobNo
1
Mayank Dixit
9532771738
2
Mona Dixit
9005408263


Adding title with Employee Name in capital letter :

Explan with query:-

There is a table Name Employee which has EmployeeID, EmployeeName, EmployeeMobNo Columns Name. Now I want to add title before EmployeeName then query below:- 

 SELECT        'Mr. /Mrs./Miss:' + UPPER (SUBSTRING (EmployeeName, 1, 10)) AS NameWithTitle,   EmployeeMobNo
FROM            Employee

Output :

NameWithTitle
EmployeeMobNo
Mr./Mrs./Miss :MAYANK DIXIT
9532771738
Mr./Mrs./Miss :MONA DIXIT
9005408263