i'm new to sql and need some assistance with the following
I have a stored procedure that outputs a bunch of .csv log files into a log directory. d:\logs\
I need a script that i can add to the begining of my stored proc to delete all the csv files in d:\logs before running the rest of the script. Also, it needs a check... if there are no files in d:\logs then to continue with the script.
in the begining of my stored proc:
1. check to see if there are any files in d:\logs
2. if so delete them all, if not then continue with the script
I've read about the xp_cmdshell to do this and dts but how do i put that into my stored proc. I need an example