I am still wondering though if I am doing this the best way. So I have a web application that users can choose different criteria on a form - the web application then fires a SQL Server stored procedure - the stored procedure runs a select query based on their criteria and outputs the data to a file - the stored procedure then copies that file to another folder on our web server (using xp_cmdshell) - the stored procedure then calls a web service which emails the user a link to their file.
Is this the best/safest way to accomplish the task?