• Cool. I agree, no need to re-invent anything.

    So this should suffice for the csv export?

    xp_cmdshell "select col1,col2,col3 from table" -oc:\myfile.csv -h-1 -s",