110 pts.
 SQL 2008 job problem
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:
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.
Last Wiki Answer Submitted:  December 3, 2010  8:15 pm  by  Denny Cherry   64,520 pts.
All Answer Wiki Contributors:  Denny Cherry   64,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Thank you, sir..I shall give it a try.

 0 pts.