Reputation:
I want to update every row in my table from upper case to lower case. I searched everywhere but could not found relevant answer. I dont want it to select using SELECT
. I would like to alter permanently may be using ALTER
.
I am using SQL server 2008.
Thanks.
Upvotes: 9
Views: 52404
Reputation: 485
You can do this using string functions:
UPDATE MyTable SET MyColumn = LOWER(MyColumn)
Upvotes: 2
Reputation: 4538
UPDATE table_name SET col1 = LOWER(col1), col2 = LOWER(col2), col3 = LOWER(col3);
HTH
Edit: Updating multiple columns. Just keep on adding columns like above. There is no direct automated way to update all the columns with a single command. Well, technically it may be possible using cursors
, but I would advise against it since this looks like a one time process and you are better off with writing a command once and for all.
Upvotes: 27