I am really struggling trying to automate a script to export a sql server table into a cvs file that can sorted and put in a shared folder. I have try the export tool in sql server but can't find a way to sort the file. I also try to BCP the file in to a cvs file and couldn't get that to work. I know that this can be done. Please advised.