SQL 2008 job problem

110 pts.
Tags:
SQL 2008
SQL job scheduler
SQL Jobs
SQL Server 2008
Windows Server 2003
I have a schedule SQL2008 job to export the contents of a table to a text file each day. The job runs fine when I manually execute it, but if the schedule executes it, only 4 or 5 lines of text out of about 13000 are produced to the text file. Any ideas anyone? The job script follows: EXEC xp_cmdshell 'bcp "SELECT * FROM pesticide..krspestdata" queryout "C:tempPestproducts.txt" -T -c -r"^" -t"|"'

Software/Hardware used:
Windows 2003, SQL 2008
ASKED: December 2, 2010  3:28 PM
UPDATED: December 3, 2010  8:24 PM

Answer Wiki

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

First remove the call to xp_cmdshell. Change the job command type from TSQL to Operating System (CmdExec) and just put in the bcp call.

Discuss This Question: 1  Reply

 
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
  • DavidHa!!
    Thank you, sir..I shall give it a try.
    0 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