Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query access database from SQL management studio without using linked servers

How do I query a MS Access database directly from SQL Management Studio, without using a linked server?

Ie. something like

SELECT * FROM ["C:\Data\Accessdb.mdb"].[SomeTableInAccessDB]

Obviously this won't work but is there a away to specify the access database details within a sql query?

like image 587
user23048345 Avatar asked Apr 06 '10 09:04

user23048345


People also ask

Can you use SQL Server Management Studio without server?

Yes, you can install Management Studio (or Management Studio Express) on a workstation that doesn't have SQL Server services. Just pick Management Tools - Complete and Management Tools - Basic during setup.

Can SQL Management Studio connect to Access?

You cannot use SQL Server Management Studio (SSMS) to log into MS Access directly. SSMS is used to log into a SQLServer (such as SQL Server Express). Once logged into a SQL Server you can connect that server to MS Access as a linked server or through open rowset, etc.

Can you use SQL Server without a server?

Microsoft SQL Server can run on a network, or it can function without a network.


1 Answers

You can use OPENROWSET or OPENQUERY. For example (per Microsoft's Northwind):

 SELECT CustomerID, CompanyName
   FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
             'C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb';
             'admin';'',Customers)

Adding a linked server just allows ease of configuration, so different processes can use the connection without having to specify connection details. I don't believe a Linked Server actually adds any functionality that can't be obtained through one of the two OPEN options.

like image 179
SqlRyan Avatar answered Sep 19 '22 17:09

SqlRyan