![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
How can I change a character in a string of text. I have a bunch number that have a lower case l in them and I need to make them an uppercase L. Example; 99l5555 needs to be 99L5555. |
#3
| |||
| |||
|
|
How can I change a character in a string of text. I have a bunch number that have a lower case l in them and I need to make them an uppercase L. Example; 99l5555 needs to be 99L5555. |
#4
| |||
| |||
|
|
Brian (b.houghtby (AT) eaglecrusher (DOT) com) writes: How can I change a character in a string of text. I have a bunch number that have a lower case l in them and I need to make them an uppercase L. Example; 99l5555 needs to be 99L5555. UPDATE tbl SET col = replace(col, 'l', 'L') Or if there other lowercase as well that should be uppercase: UPDATE tbl SET col = upper(col) -- Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx |
#5
| |||
| |||
|
|
In your second example, is the word upper referring to a L in this case. Seems like that would just replace everything in that column with an L? |
|
UPDATE tbl SET col = upper(col) |
#6
| |||
| |||
|
|
I must be doing something wrong, this is my error. Msg 547, Level 16, State 0, Line 3 The UPDATE statement conflicted with the REFERENCE constraint "FK_GL_TrnsLne_IMA". The conflict occurred in database "EAGLE", table "dbo.GL_TrnsLne", column 'GLL_ItmID'. The statement has been terminated. |
#7
| |||
| |||
|
|
Brian (b.hough... (AT) eaglecrusher (DOT) com) writes: How can I change a character in a string of text. I have a bunch number that have a lower case l in them and I need to make them an uppercase L. Example; 99l5555 needs to be 99L5555. UPDATE tbl SET col = replace(col, 'l', 'L') Or if there other lowercase as well that should be uppercase: UPDATE tbl SET col = upper(col) -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books... Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
How can I change a character in a string of text. I have a bunch number that have a lower case l in them and I need to make them an uppercase L. Example; 99l5555 needs to be 99L5555. |
#10
| |||
| |||
|
|
Sorry, Let me start over. I am trying to do a mass change of a bunch of numbers that a user entered incorrectly. He entered them with a lower case letter instead of uppercase. The numbers all begin with a 99l and I want to do a mass replace to change them all to a 99L. The numbers have a suffix that is not constant like the prefix. Example; 99l555, 99l556, 99l557 and so on. The name of the table is dbo.item and the column is ima_itemid. Here is my select statement. Select * from dbo.item where ima_itemid like '99l%' This result gives me a mixture of 99l's and 99L's. So apparently the user eventually started entering them the correct way, in case that is an issue having a mixture. It appears that my select statement doesn't care about case since I get upper and lower, although I used lower in my select. Hope this clarifies some. |
![]() |
| Thread Tools | |
| Display Modes | |
| |