• Once you've created the Stored Procedure as has been suggested, in addition to using bcp you could also use the SQLCMD utility to execute the stored procedure and output the results to file or probably even more elegant and somewhat more flexible you could use Powershell...

    If you need help with any of the suggested approaches you can always post back.