Click here to Skip to main content
15,883,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI.

I have a batch file which runs Stored procedure and generated a csv file.this is working perfectly but i want to send the same csv file as email attachment and that also automatically. No user interaction is there to send report.

I need help to send the same csv file through any script which will run on date which i will set in windows task scheduler.

BATCH file code is as under :

sqlcmd -Q "exec SP_Report_EmailScheduler" -S 195.168.17.1\SQLEXPRESS2012 -U sa -P abc -s, -W -d XYZ | findstr /V /C:"-" /B | replace-null.exe > C:\yourOutput.csv

Thanks in advance.
Posted
Updated 10-Jul-14 18:44pm
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900