Forums (RSS 2.0)" href="http://www.simple-talk.com/community/forums/rss.aspx?ForumID=-1&Mode=0" />
Click here to monitor SSC

SQL Server Excel Workbench

Last post 11-18-2011, 3:11 AM by swapnajeet. 131 replies.
Page 2 of 9 (132 items)   < Previous 1 2 3 4 5 Next > ... Last »
Sort Posts: Previous Next
  •  02-14-2007, 1:05 AM Post number 18734 in reply to post number 71297

    Fantastic

    Good work done by Robyn and excellent.
    She looks beautiful.
  •  02-14-2007, 3:35 AM Post number 18736 in reply to post number 71297

    • Robyn Page is not online. Last active: 19-10-2010, 1:15 PM Robyn Page
    • Top 75 Contributor
    • Joined on 10-19-2006
    • Chelmsford, Essex
    • Level 2: Deep Blue

    Re: Reading Excel Sheet - without sheet name?

    It is possible to specify the first sheet through automation, but I cannot find a way of doing it through a link or ADODB. The 'table' has to be named.
    The best bet might be an automation procedure that accessed the first worksheet and then, if necessary, renamed it to a standard name of your choosing? Then it is all easy.
    Has anyone else got an idea?
  •  02-14-2007, 10:54 AM Post number 18751 in reply to post number 71297

    SQL Server Excel Workbench

    Brilliant. I had done this kind of work previously using DTS but this approach makes it more portable and more reusable. I may even convert my old routines to use this method. If either of you (or both) are considering a DBA job in Canada let me know. Seriously, this caliber of work is worth a job offer. (In your case Phil I'd need your real name ... eventually)
  •  02-14-2007, 10:56 AM Post number 18753 in reply to post number 71297

    • fhanlon is not online. Last active: 08-23-2010, 9:42 AM fhanlon
    • Top 200 Contributor
    • Joined on 09-21-2006
    • Winnipeg, Manitoba Canada
    • Level 1: Deep thought

    SQL Server Excel Workbench

    My last post came out as Anonymous which I am not (always)
  •  02-15-2007, 2:29 AM Post number 18767 in reply to post number 71297

    Re: SQL Server Excel Workbench-Job offer

    We're both pleased you liked the article. We don't decry the use of DTS for doing Excel integration work-we use DTS a fair amount, but sometimes one really needs to do more than DTS was designed for.

    We're both very flattered by the job offer!
  •  02-15-2007, 3:10 AM Post number 18768 in reply to post number 71297

    Re: SQL Server Excel Workbench

    Ma'm Robyn,
    you made mention about 'an ADODB
    version is very simple to do and can be made much faster for reads and writes'. Do you mean an excel workbench adodb version? If so, please write a sql server excel workbench using an ADODB. Thank you.
  •  02-17-2007, 11:53 AM Post number 18841 in reply to post number 71297

    • Robyn Page is not online. Last active: 19-10-2010, 1:15 PM Robyn Page
    • Top 75 Contributor
    • Joined on 10-19-2006
    • Chelmsford, Essex
    • Level 2: Deep Blue

    An ADODB version

    Yes. Phil and I adapted Phil's existing DMO version simply because he was using it to save configuration stuff from a whole lot of Servers. If you use ADODB, you can use the 'Range(MyRange).CopyFromRecordset rs' command in order to fill the cells, which is much faster than using the iterative approach we used.
  •  02-20-2007, 10:58 PM Post number 19032 in reply to post number 71297

    SQL Server Excel Workbench

    Hi,

    Thanks for your artical on this subject

    I want to know more about scripting for SQL Server 2000.
  •  02-23-2007, 4:35 PM Post number 19225 in reply to post number 71297

    SQL Server Excel Workbench

    Thanks, some great ideas.

    But spExecute_ADODB_SQL fails if you loop more than 64 times.

    It needs a needs an extra step:
    exec @hr = sp_OAMethod @objConnection, 'Close'
  •  02-23-2007, 5:05 PM Post number 19231 in reply to post number 71297

    SQL Server Excel Workbench

    Thanks, some great ideas.

    But spExecute_ADODB_SQL fails if you loop more than 64 times.

    It needs a needs an extra step:
    exec @hr = sp_OAMethod @objConnection, 'Close'
  •  02-24-2007, 3:27 AM Post number 19248 in reply to post number 71297

    Re: spExecute_ADODB_SQL fails if you loop more than 64 times.

    Oops! Quite right. Mea Culpa! Thanks very much for the bugfix. I must confess that neither Robyn or I looped it 64 times!
  •  03-19-2007, 1:22 AM Post number 20963 in reply to post number 71297

    SQL Server Excel Workbench

    Thanks, Robyn & Phil, for an article that was both informative and useful, especially to people like me who were not trained as DBAs but drifted into using SQL as part of their job.

    I would have posted this earlier but I was too busy adapting bits of your C.R.U.D for my own work.
  •  03-26-2007, 8:48 AM Post number 21321 in reply to post number 71297

    Really cool script

    Thank you for this magnificent script.

    I used the script for my reports and discovered, that if you change some small thing in the script you can actually reuse 1 file for many worksheets.

    This is the code that I Used to be able to append or create a new workbook using your code startin with a few lines of your code first.


    --so now we have the queryresults. We start up Excel
    IF @hr=0
    SELECT @strErrorMessage='Creating the Excel Application, on '
    +@SourceServer, @objErrorObject=@objExcel
    IF @hr=0
    EXEC @hr=sp_OACreate 'Excel.Application', @objExcel OUT
    IF @hr=0 SELECT @strErrorMessage='Getting the WorkBooks object '
    IF @hr=0
    EXEC @hr=sp_OAGetProperty @objExcel, 'WorkBooks',
    @objWorkBooks OUT

    IF @hr=0
    EXEC @hr = sp_OASetProperty @objExcel, 'DisplayAlerts', 'FALSE'
    --create a workbook or append a workbook
    DECLARE @status int
    EXEC master..xp_fileexist @filename, @Status OUTPUT

    IF @status = 1
    BEGIN
    SELECT @strErrorMessage='Opening a workbook ', @objErrorObject=@objWorkBooks
    IF @hr=0
    SELECT @strErrorMessage='Opening the workbook as "'+@filename+'"', @objErrorObject=@objRange, @command = 'Open("' + @filename + '")'
    IF @hr=0
    EXEC @hr=sp_OAGetProperty @objWorkBooks, @command, @objWorkBook OUT
    END
    ELSE
    BEGIN
    IF @hr=0
    SELECT @strErrorMessage='Adding a workbook ', @objErrorObject=@objWorkBooks
    IF @hr=0
    EXEC @hr=sp_OAGetProperty @objWorkBooks, 'Add', @objWorkBook OUT
    END

    Hope it helps someone.

    Regards, Denis
  •  03-27-2007, 8:14 AM Post number 21385 in reply to post number 71297

    Re: Really cool script.

    Yeah. That is great, Denis. Thanks for the contribution. Much appreciated.
  •  03-29-2007, 11:13 AM Post number 21530 in reply to post number 71297

    Great scripts

    Hi Robyn and Phil,
    Some great scripts, nice to see several different solutions presented to a particular challenge.

    One question about the ADO script, you replace in @DDL the stub %worksheet with the worksheet name passed in the @worksheet parameter, but please can you give an example of how it is used?

    Cheers

    David
Page 2 of 9 (132 items)   < Previous 1 2 3 4 5 Next > ... Last »
View as RSS news feed in XML