I'm running a set of SQL statements where the results get saved to a file. I've set this up in Query analyzer under Tools|Options|General. This works great. However, This will become a scheduled process. I am not doing a straight export because I need to group data and do some other formatting stuff, NOT in the way that SQL groups but in the way that Crystal Reports does it where group appears once then the details. So my question is, is there a way to do what QA does programmatically?