I have several SQL update/delete statements I run during a payroll cycle. When I run a SQL that does not have any records that meet the selection criteria, I do not get a log created. I can run the same SQL in SQLServer, and it shows (0 records updated).
Software/Hardware used:
ASKED:
January 5, 2011 5:52 PM
UPDATED:
January 21, 2011 5:08 PM
Are you asking about doign this on an AS400?
No this is being done on SQLServer.
I am using a redirect statement like this:
> %LOGDIR%RegGTNPERS_09_RATE_FIX.log 2>&1
Most of these work OK, except for when the resukts equal 0 records for some of my SQL’s
It should have been:
> %LOGDIR%RegGTNPERS_09_RATE_FIX.log 2>&1
Try adding SET NOCOUNT OFF to your SQL.
I have added the SET NOCOUNT OFF to my SQL’s and I am still not getting any logs created when no records qualify.
Any other ideas.