Click here to Skip to main content
15,880,543 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
retrieve data from access mdb file and insert into sql server .how to do this using query or t-sql.
Posted
Updated 3-Oct-13 0:22am
v2

Hi,

Since Microsoft Access and Sql Server is under single family Microsoft you can do it with ease.
Try this link[^].
I hope this could help you a bit.

Regards,
RK
 
Share this answer
 
v2
SQL
--To check the driver is installed or not open ODBC Data Source Administrator (Start > Run > type ODBCAD32.EXE and hit enter) and check under the Drivers tab
SET NOCOUNT ON;

Exec sp_configure 'show advanced options', 1;
RECONFIGURE;
GO

Exec sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO

SELECT *
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=C:\AddressBook.mdb')...[tblContacts]

--SELECT [Field1],[Field2],[Field3],[Field4]
--FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=Location:\Filename.mdb')...[TableName]

Exec sp_configure 'Ad Hoc Distributed Queries', 0;
RECONFIGURE;
GO

Exec sp_configure 'show advanced options', 0
RECONFIGURE;
GO
 
Share this answer
 
Comments
Raja Sekhar S 4-Oct-13 8:21am    
Did it Solved Your Problem...?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900