SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


My favorite way to access Excel files


My favorite way to access Excel files

Author
Message
gsc_dba
gsc_dba
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1751 Visits: 2017
(5/20/2009)
Please read this MS article: http://support.microsoft.com/kb/814398

I experienced this same error and the article helped solve the problem.



I also found this useful when querying a workbook with several worksheets:

EXECUTE SP_TABLES_EX 'your_linked_servername_goes_here'



which returns the names of the worksheets

_____________________________________________________________________________________
[font=Courier New]gsc_dba[/font]
malleswarareddy_m
malleswarareddy_m
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2193 Visits: 1189
Hi,
I tested this but it is not worked for me.

when i use openrowset it showed executed.[color=#00ffff][/color]
but when i used opendatasource it shows an exception linked server is null.
and also even though i created linked server through Managementstudio.it created linked server
but does not show the table in it.
In my system IIS was not installed .is there is link between iis and linked server.Please send the details reply.

Malleswarareddy
I.T.Analyst
MCITP(70-451)
WarrenSB
WarrenSB
SSC-Enthusiastic
SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)

Group: General Forum Members
Points: 108 Visits: 36
Gaby, Jacob

We have used the ACE provider with Excel 2007 and Excel 2010 Beta files and itworks great with a couple of issues.

1 - no 64 bit as discussed previously in this post and

2 - if you convert the file back to an excel 2003 version and use the jet provider - it is about twice as fast.... not sure why this is but the ace driver is slow.
WarrenSB
WarrenSB
SSC-Enthusiastic
SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)

Group: General Forum Members
Points: 108 Visits: 36
one other thing that I forgot to mention - you need to install either Excel 2007 on the server that you are executing on or download the AccessDatabaseEngine driver from

http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en

also remember that when you run these queries via Management studio, the source files must be on server themselves.

you cannot connect to a local instance of SQL and execute against files not on your local machine.
Rich Mechaber
Rich Mechaber
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1539 Visits: 3665
I use OPENDATASOURCE, too. In addition to the gotchas mentioned above (64-bit, file must reside on server), you might also want to know:

- The filename must be hard-coded; you cannot pass a variable to it. You can use dynamic SQL as a work-around. Here's a write-up: http://www.sommarskog.se/dynamic_sql.html#OPENQUERY

- This might be obvious, but you can't have the file open in Excel. This is annoying if you're massaging data in Excel and using SQL to import/QC the data.

Thanks,
Rich
Iwas Bornready
Iwas Bornready
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13666 Visits: 885
Thanks for the script.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search