Bulk Updates (1 Viewer)

GaleT

Registered User.
Local time
Today, 05:14
Joined
Oct 18, 2019
Messages
72
That was it!!!! It worked beautifully :) The final script looks like this... just to close this thread out gracefully...

This SQL is used in a query to change the 'Status' field entry to 'Expired' in 48 specific records in the "Documents Table"

Update [Documents Table]
SET Status = 'Expired'
Where ProjNum in ('AZ1432141','AZ19S0127','AZ19S0168','AZ19S0701','CO1232058','CO1232305','CO15S0372','CO18S0872','CO18S1297','CO18S1447','CO19S0917','IA13S1027','IA15S0402','IA18S0367','IA18S0474','IA19S0387','IA19S0456','ID14L0113','MN0802580','MN12S7444','MN13T0236','MN14S0819','MN15S0129','MN15S0361','MN16S0171','MN18S0576','MT18S0420','ND18S0048','NM13T0012','NM17T0393','OR1130219','OR18S0473','OR19S0348','UT12S7210','UT16S0098','UT18S0012','UT18S0615','UT19S0192','WA0800034','WA1100483','WA1130263','WA16L0478','WA17T1476','WA17T1509','WA18S0336','WA18S0892','WA18S0958','WY1000445')

Thank you all for your help. This opens the door I needed to process bulk changes in the database. Perfect ending to the day :)

Gale
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:14
Joined
Feb 28, 2001
Messages
27,236
Gale, one last way to make this more efficient for the future...

IF (and this might be a really BIG if) you can make a separate list of items in a "selected items" table that maybe only has ONE FIELD in it, a text field for your ID numbers, your syntax would be:

Code:
UPDATE [Documents Table] SET Status = 'Expired' WHERE ProjNum IN (SELECT PJNUM FROM ITEMLISTTABLE) ;
 

GaleT

Registered User.
Local time
Today, 05:14
Joined
Oct 18, 2019
Messages
72
Great idea, thank you The_Doc_Man. Listing the records in the SQL code has a practical limit due to difficulty in reading the list. But placing the list in a table is very clean, easy to read and easy to check for errors. That will be my "Heavy Duty" bulk record update method :)

Gale
 

Users who are viewing this thread

Top Bottom