updating multiple records at time

Last Post 13 Apr 2009 08:31 AM by triley01. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
triley01
New Member
New Member

--
10 Apr 2009 07:34 AM
Hey,

I am trying to figure out a statement that will update multiple records at a time. I found our db has State records that are spelled out instead of abbreviated. Example: New Jersey instead of NJ. So my question is how can I do many at once instead manually updating each state at time.


--one state at a time
UPDATE NAME
SET State_Province = 'NJ'
WHERE State_Province = 'New Jersey'


So I want a script that can do all of these at once. Thanks for any help!

Alabama AL
Arizona AR
Arkansas AS
California CA
Colorado CO
Connecticut CT
Delaware DE
District of Col DC
Florida FL
Georgia GA
Hawaii HI
Idaho ID
Illinois IL


triley01
New Member
New Member

--
13 Apr 2009 08:31 AM
Thanks! and one note. Include the WHERE State_Province in ('New Jersey', 'Alabama') etc or the statement fails trying to put null values in records that are not included in the CASE statement.
You are not authorized to post a reply.

Acceptable Use Policy