Who would run the query? Excel can't, SQL Server can't, Access might come pretty close, and .NET can....with a few steps along the way. I have a class over in the .NET CodeBank that I wrote to export datatables and datareaders. That might not apply for you, though.