Exporting data from database to a file, zipping it and mailing
-
Hi, I need to export data from DB (SQL Server 2005) to a file (eg. Excel, text file or any other format, .CSV) at the same time preserving the rows and column schema of the DB. Then I need to zip it and mail it across to a mail id. One approach is to use File object to create a text or excel file, but the data will be scrambled when it will be written on to the file. I need to do all this programmatically.Please help.
-
Hi, I need to export data from DB (SQL Server 2005) to a file (eg. Excel, text file or any other format, .CSV) at the same time preserving the rows and column schema of the DB. Then I need to zip it and mail it across to a mail id. One approach is to use File object to create a text or excel file, but the data will be scrambled when it will be written on to the file. I need to do all this programmatically.Please help.
Why not use the "FOR XML" with the SELECT statment? This way you get a XML representation, which could be saved to file etc etc.. ?
namaste, Nitin Koshy http://devwaves.blogspot.com ...and I thought I knew