>>What is the most efficient way to accomplish this taskAre you talking about the hourly sceduling or looking for a better update query?for scheduling look at using a sql job.for more efficient code this could work:use pubsset nocount ongocreate table client (clientid int, organization varchar(3) null, address varchar(50))goinsert clientselect 1, null, '23YYYYYY' union allselect 2, null, '01NNNNN' union allselect 4, null, '99 lasdlkjadf' union allselect 3, null, 'NNNNNN' goupdate a set Organization = convert(varchar,convert(int, b.org) + 2)from Client ajoin ( select clientid ,left(address, 2) org from client where left(address, 2) like '[0-9][0-9]' and organization is null ) b on b.clientid = a.clientidselect * from clientgodrop table client
output:clientid organization address ----------- ------------ -------------------------------------------------- 1 25 23YYYYYY2 3 01NNNNN4 101 99 lasdlkjadf3 NULL NNNNNN
EDIT:you should probably put something in to prevent the same row from being updated over and over again. I'll add one possible way to the query aboveBe One with the OptimizerTG