+ Reply to Thread
Results 1 to 6 of 6

SQL Server Management Studio + MS Excel/Access Files?

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    SQL Server Management Studio + MS Excel/Access Files?

    I'm interested in using SQL Server Management Studio to run queries on an Excel or Access file

    I tried googling but most of the results confuse this with similar-but-different concepts (see bottom of this post). The few remaining results didn't provide enough information for me to get this to work.

    Is there any forum user who could kindly inform me how I can do this?


    To avoid any confusion, I would like to stress that this thread is NOT about:
    1. importing an Excel or Access file into SQL Server Management Studio
    2. connecting to a database from VBA using ADO
    I know how to do the above two and they are not what I am looking for.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: SQL Server Management Studio + MS Excel/Access Files?

    The only ways I can think of is through using a linked server that acts as a proxy https://msdn.microsoft.com/en-GB/library/ms188279.aspx or, on a more ad-hoc basis using something like opendatasource

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: SQL Server Management Studio + MS Excel/Access Files?

    Good to hear from you again, Kyle

    This sounds promising. Thank you +1

    I will leave this thread open while I look into this. If I run into any major problems, I will update the thread.

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: SQL Server Management Studio + MS Excel/Access Files?

    I have been told by the friend I asked to do the setup that using a linked server isn't possible unless both Office & SQL Studio are 64 bit? (I installed my Excel as 32 bit so I could keep using MZTools!)

    Does anyone know if this is so and if yes, is there any workaround for it?

    I had a go myself and I managed to get a connection to a test excel workbook but none of the sheets showed up under Tables???

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: SQL Server Management Studio + MS Excel/Access Files?

    Did you try running a query even though you couldn't see the tables listed?

  6. #6
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: SQL Server Management Studio + MS Excel/Access Files?

    Quote Originally Posted by Kyle123 View Post
    Did you try running a query even though you couldn't see the tables listed?
    I confess I didn't think of trying something like that.

    (Trys it). No good. It gives an error message: " Invalid object name 'tablenameexample'. "

    I overlooked mentioning before that the connected workbook doesn't appear under Databases in SQL Studio. It appears under 'Server Objects' -> 'Linked Servers' -> TEST (TEST is the name of the connection I gave to the excel workbook).

    If I right click the linked server 'TEST' and choose 'Test Connection' I get "The test connection to the linked server succeeded."

    If I right click Tables (under ServerObjects>LinkedServers>TEST>Catalogs>default>Tables) and choose Refresh, I get an error message:

    Failed to retrieve data for this request (Microsoft.SqlServer.Management.Sdk.Sfc)

    Additional information:
    L>An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
    L> Cannot obtain the required interface("IID_IDBSchemaRowset") from OLE DB provider "ADsDSOObject" for linked server "TEST". (Microsoft SQL Server, Error: 7301)
    Last edited by mc84excel; 03-23-2016 at 06:29 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel (PowerPivot) vs MS Access vs SQL Server
    By krazykrivda in forum Excel General
    Replies: 4
    Last Post: 05-20-2015, 08:17 AM
  2. Using Remote Server-Need to Hyperlink to .pdf files from Excel. 65,000 Files.
    By tfairfield in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2015, 08:22 PM
  3. [SOLVED] Excel Server Management Script - Free Disk Space
    By hans_wurst in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2014, 03:22 AM
  4. VBA: Using SQL In Excel VBA To Extract Data To Access Or SQL Server
    By stevevb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-19-2013, 12:24 PM
  5. Replies: 0
    Last Post: 07-13-2012, 02:04 PM
  6. Connecting Excel, Access and SQL Server
    By mp80237 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-01-2006, 12:00 PM
  7. [SOLVED] Connecting Excel, Access and SQL Server
    By mp80237 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2006, 11:00 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1