SQLCMD does not create a log file

50 pts.
Tags:
SQL Log Files
SQL Records
SQL Server
SQLCMD
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).

Answer Wiki

Thanks. We'll let you know when a new response is added.

</pre>
Should have been:
> %LOGDIR%\RegGTN\PERS_09_RATE_FIX.log 2>&1

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne
    Are you asking about doign this on an AS400?
    41,380 pointsBadges:
    report
  • Harv2002
    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
    50 pointsBadges:
    report
  • Harv2002
    It should have been: > %LOGDIR%RegGTNPERS_09_RATE_FIX.log 2>&1
    50 pointsBadges:
    report
  • Hlx
    Try adding SET NOCOUNT OFF to your SQL.
    690 pointsBadges:
    report
  • Harv2002
    [...] SQL CMD does not create a log file [...]
    0 pointsBadges:
    report
  • Harv2002
    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.
    50 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following