Posts

Showing posts from September, 2008

Colombia

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

Erase a Registry Key using a .reg file

Erase-a-RegKey. - Miscellaneous Debris : "Erase-a-RegKey" to Delete values: use a dash on the value like this: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\MyStuff] "MyLittleValue"=- "MyLittleValue2"=- But if you still need to delete entire key Windows Registry Editor Version 5.00 [-HKEY_LOCAL_MACHINE\Software\MyStuff] original post by AvnerK in Erase-a-RegKey. - Miscellaneous Debris