473,396 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Question: changing case on existing records

DW
Greetings:

I have a SQL 2000 database, in which about 1% of the records are in
lower case. I need to make them UPPER CASE.

Is there a function to determine and change the case of existing
records, or will I have to re-write the records manually?

Thanks,

DW

Jul 23 '05 #1
6 1340
update mytable set mydatum = UPPER(mydatum)
where mydatum != UPPER(mydatum)

Jul 23 '05 #2

"jo*******@BEA.com" <jo***********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
update mytable set mydatum = UPPER(mydatum)
where mydatum != UPPER(mydatum)


You think that would work, as simple as it is, right? ... but NO!

That will only work if the database is case sensitive.

With a case insensitive collation the compaison will return true even if
they aren't

in that case add a specific COLLATE clause to insure that the comparison is
done case sensitive.

Jul 23 '05 #3
Hi

Use the COLLATE clause and specify a case sensitive collation.

SELECT Col1
FROM ( SELECT 'A' AS Col1
UNION ALL SELECT 'a' ) DT
WHERE col1 = 'A'

SELECT Col1
FROM ( SELECT 'A' AS Col1
UNION ALL SELECT 'a' ) DT
WHERE col1 = 'A' COLLATE Latin1_General_CS_AI

Alternatively a more permanent option would be to change the column
collation using the ALTER TABLE statement or possibly propage changes up
through the whole system
http://tinyurl.com/5m7qv

John
"David Rawheiser" <ra*******@hotmail.com> wrote in message
news:xF*********************@bgtnsc05-news.ops.worldnet.att.net...

"jo*******@BEA.com" <jo***********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
update mytable set mydatum = UPPER(mydatum)
where mydatum != UPPER(mydatum)


You think that would work, as simple as it is, right? ... but NO!

That will only work if the database is case sensitive.

With a case insensitive collation the compaison will return true even if
they aren't

in that case add a specific COLLATE clause to insure that the comparison
is done case sensitive.

Jul 23 '05 #4
DW
Well, it appears that, in my case at least, my database is
case-sensitive - the UPPER function worked fine.

Thanks!

Jul 23 '05 #5
>> it appears that, in my case at least, my database is case-sensitive
- the UPPER function worked fine. <<

Now put a constraint on the column so you do not have to do this again.
Mop the floor, but remember to fix the leak.

Jul 23 '05 #6
DW
Good plan.

Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
6
by: DH | last post by:
I have a VERY basic question about figuring database size. I've inherited a database which is generally similar to this basic one: Item, Red, Blue, Green, Yellow (text), (int),(int),(int),(int)...
4
by: Paul Gorodyansky | last post by:
Hi, I've read most of the discussions about "calculation of string width in pixels or points" - they mostly talk about MeasureString (and that it's not exact width) or more presize but...
29
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this...
2
by: Bob | last post by:
I have noticed that as one adds related tables to a bindingsource and dataset(vs2005 Vb.Net Sql Server 2005), the TODO and following code that fills the datasets on form load are written to the...
5
by: sparks | last post by:
We have a database with 1600+ records in it. They are linked across 7 tables by an ID type autonumber. Now we want(not I want LOL) to remove the first 1200 records no problem but they also...
17
by: (PeteCresswell) | last post by:
I've got apps where you *really* wouldn't want to delete certain items by accident, but the users just have to have a "Delete" button. My current strategies: Plan A:...
4
by: Queenie | last post by:
I have an existing contact information database which consists of a number of tables, the main table has a primary key which is currently set to NUMBER. There is a relationship between it and 2...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.