Solved

fixing lowercase letters to uppercase

Posted on 2010-09-16
4
441 Views
Last Modified: 2012-05-10
Hi I have the following query which gives the lower case lettered words, is there a way we can fix the lowercase letters to get the uppercase ones?
USE CONTROLM_EM
SELECT      SCHED_TABLE, JOB_NAME
FROM  DEF_JOB A
JOIN  DEF_TABLES B ON A.TABLE_ID = B.TABLE_ID
WHERE DATA_CENTER = 'PROD'
AND SCHED_TABLE NOT LIKE 'WORKSPACE%'
AND CAST(JOB_NAME AS VARBINARY(8000)) <> CAST(UPPER(JOB_NAME) AS VARBINARY(8000))
ORDER BY SCHED_TABLE, JOB_NAME
0
Comment
Question by:shyamaladevib
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
ad4m1 earned 167 total points
ID: 33697013
Simply prefix your fields with upper(**FieldName**)
so presuming you want your JOB_NAME to be returned in upper case you would have the following code.
SELECT      SCHED_TABLE, upper(JOB_NAME)
FROM  DEF_JOB A
JOIN  DEF_TABLES B ON A.TABLE_ID = B.TABLE_ID
WHERE DATA_CENTER = 'PROD'
AND SCHED_TABLE NOT LIKE 'WORKSPACE%'
AND CAST(JOB_NAME AS VARBINARY(8000)) <> CAST(UPPER(JOB_NAME) AS VARBINARY(8000))
ORDER BY SCHED_TABLE, JOB_NAME
 
Hope this helps.
0
 
LVL 32

Assisted Solution

by:Ephraim Wangoya
Ephraim Wangoya earned 166 total points
ID: 33697739
Use update  

UPDATE DEF_JOB
SET SCHED_TABLE = UPPER(SCHED_TABLE), JOB_NAME = UPPER(JOB_NAME)
WHERE DEF_JOB.TABLE_ID IN
(SELECT A.TABLE_ID
      FROM  DEF_JOB A
      JOIN  DEF_TABLES B ON A.TABLE_ID = B.TABLE_ID
      WHERE DATA_CENTER = ' PROD'
      AND SCHED_TABLE NOT LIKE 'WORKSPACE%'
      AND CAST(JOB_NAME AS VARBINARY(8000)) <> CAST(UPPER(JOB_NAME) AS VARBINARY(8000)))
0
 
LVL 4

Assisted Solution

by:parthmalhan
parthmalhan earned 167 total points
ID: 33710974
try the following code:

USE CONTROLM_EM
SELECT      upper(SCHED_TABLE),upper(JOB_NAME)
FROM  DEF_JOB A
JOIN  DEF_TABLES B ON A.TABLE_ID = B.TABLE_ID
WHERE DATA_CENTER = 'PROD'
AND SCHED_TABLE NOT LIKE 'WORKSPACE%'
AND CAST(JOB_NAME AS VARBINARY(8000)) <> CAST(UPPER(JOB_NAME) AS VARBINARY(8000))
ORDER BY SCHED_TABLE, JOB_NAME
0
 

Author Closing Comment

by:shyamaladevib
ID: 33737364
thanks!
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question