Create Excel XLS from T-SQL
Excellent script to create an excel file with as many tables as you want and populate them from a simple T-SQL statement. It uses OLE, ADO, Jet4 ISAM, and Linked Server to connect to the excel file. the author "David A. Long" published it to http://www.sqlservercentral.com/scripts/Miscellaneous/30763/ -- Create XLS script DAL - 04/24/2003 -- -- Designed for Agent scheduling, turn on "Append output for step history" -- -- Search for %%% to find adjustable constants and other options -- -- Uses OLE for ADO and OLE DB to create the XLS file if it does not exist -- Linked server requires the XLS to exist before creation -- Uses OLE ADO to Create the XLS Worksheet for use as a table by T-SQL -- Uses Linked Server to allow T-SQL access to XLS table -- Uses T-SQL to populate te XLS worksheet, very fast -- PRINT 'Begin CreateXLS script at '+RTRIM(CONVERT(varchar(24),GETDATE(),121))+' ' PRINT '' GO SET NOCOUNT ON DECLARE @Conn int -- ADO Co...