I have to copy file daily from SQL job to the file server. The SQL job should create a folder first day of each month as 'Jan', 'Feb' etc.. and upload the file accordingly.
If it's the last day of the month then it should create year folder '2012' and then month folder 'Jan' then copy the output of select table.
How do I do this in xp_cmdshell? Can anyone give me a example or sample code?