Reputation: 11982
Using SQL Server 2005
Table1
ID
Abc0012
BED0045
cAB0027
....
I want to replace all the ID values in the table1 like ABC0012, BED0045, CAB0027.
I want to make all characters as caps
Need Query Help
Upvotes: 1
Views: 91
Reputation: 4928
Here's a complete script that shows how to use the UPPER() function to achieve this:
declare @mytable table (
somevalue varchar (20)
)
insert into @mytable(
somevalue
)
values (
'abc123'
)
insert into @mytable(
somevalue
)
values (
'xYz456'
)
insert into @mytable(
somevalue
)
values (
'gjriwe345'
)
update @mytable
set somevalue = upper(somevalue)
select *
from @mytable
Upvotes: 1
Reputation: 10850
If you want to change them:
UPDATE
Table1
SET
ID = UPPER(ID)
Could work, this is untested though.
Upvotes: 2
Reputation: 2032
I believe you should be able to do something like this:
UPDATE Table1 SET ID = UPPER(ID)
Upvotes: 1
Reputation: 11371
Use upper
:
SELECT upper(ID) FROM YourTable
or:
UPDATE YourTable SET ID=upper(ID)
Upvotes: 2