Solved

fixing lowercase letters to uppercase

Posted on 2010-09-16
4
439 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Whats wrong in this query - Select * from tableA,tableA 11 53
While in ##Table - Help 4 22
monitoring configuration for SQL server DB 32 49
SQL Recursion schedule 13 35
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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