Introduction:
In this article I will explain how to write a query to convert or change lowercase to uppercase or uppercase to lowercase characters in SQL server.
In this article I will explain how to write a query to convert or change lowercase to uppercase or uppercase to lowercase characters in SQL server.
Description:
In
previous post I explained how to alter or modify or delete or
change already existing column in datatable in SQL Server and many articles
relating to SQL
Server.
Now I will explain how to convert or change lowercase to uppercase or lowercase
to uppercase characters in SQL
Server.
Here I will explain with one example for that I have one table UserDetails like as shown below
Syntax
to convert uppercase characters
If
we want to convert characters to uppercase that syntax will be like this
SELECT UPPER(ColumnName) FROM TableName
|
Ex:
SELECT UPPER(UserName) as UserName, UPPER(FirstName) as FirstName, UPPER(LastName) as LastName FROM
UserDetails
|
OutPut
Syntax
to convert Lowercase characters
If
we want to convert characters to lowercase that syntax will be like this
SELECT LOWER(ColumnName) FROM TableName
|
Ex:
SELECT LOWER(UserName) as UserName, LOWER(FirstName) as FirstName, LOWER(LastName) as LastName FROM
UserDetails
|
OutPut
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
6 comments :
Hi
Suresh
The Query is good,where we use this type of query in real time applications,will you please explain with a example.
Thanks&Regards
Hareesh.A
nhjh
how to view the word file in asp.net using sql
Dear sir Suresh if we run this query it convert the coumn lower as well as upper.but when i use the SELECT*FROM "Tablename".the table have same reults as before...........................
so what it' use
r.k saini
rajneesh saini
when u write the query select upper(columnname) from table name that means it will show you only in uppercase but in the table the value could not be changed...
Hi! Here's my dilemma. How can I write a carrier name "EMPLOYERS" to output "Employers"?
I really don't need to lowercase the entire "EMPLOYERS" string. Can you please help? Thanks!
Note: Only a member of this blog may post a comment.