my $rows = $dbh->do( 'UPDATE MyTable SET note_date = GETDATE() WHERE ErrorCode IS NOT NULL' ); if ($rows) { # true, even if zero rows were affected. print 'Found and updated rows: (',$rows,")\n"; } else { warn 'Error during update query'; }