Click here to Skip to main content
12,886,393 members (43,728 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


9 bookmarked
Posted 17 Nov 2009

Export data from SQL Server to MS Access

, 18 Oct 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
The purpose of this article is to provide a fast but easy way to export data from SQL Server to MS Access.


Exporting data from SQL Server to MS Access can be achieved in a variety of ways. The purpose of this article is to provide a fast but easy way to export data from SQL Server to Access.


You must know how the select & insert statements work in SQL Server.

Using the Script

Create an access file named ‘Test’ on C:\ drive having the table and their columns same as that of SQL and use this script.

The script below is amazingly simple to use.

'Select * From ‘AccessTableName’) 
Select * From ‘SQLTableName’

The OPENROWSET function in SQL Server provides a way to open an OLE DB compatible data source (i.e. MS Access in our case) directly from your SQL script.


OPENROWSET ( 'provider_name' 
, { 'datasource' ; 'user_id' ; 'password' 
| 'provider_string' } 
, { [ catalog. ] [ schema. ] object 
| 'query' } 


MSDN Library.


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


About the Author

Muhammad Shahid Farooq
Software Developer (Senior) ForeVision Business Solutions
Pakistan Pakistan
Software Engineer | System Integrator | Architect

Muhammad Shahid Farooq is a software engineer with having experience of 9+ years of working on ADO.Net, C#.Net, VB.Net, VB6/VBA, SQL Server, Oracle, MySQL and other latest technologies. He holds Bachelor’s degree in Computer Science from the University of Central Punjab, Lahore, Pakistan. To contact Shahid, email him at

You may also be interested in...


Comments and Discussions

QuestionNeed Help Pin
mute_gemini5-Mar-14 20:10
membermute_gemini5-Mar-14 20:10 
AnswerRe: Need Help Pin
Muhammad Shahid Farooq9-Mar-14 21:56
professionalMuhammad Shahid Farooq9-Mar-14 21:56 
Questionerror Pin
Mustafa Magdy25-Sep-11 10:38
memberMustafa Magdy25-Sep-11 10:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 18 Oct 2011
Article Copyright 2009 by Muhammad Shahid Farooq
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid