Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 SQL query output to access

Author  Topic 

parag.sv
Starting Member

11 Posts

Posted - 2009-11-24 : 15:13:06
Hi all,

I have been asked to get the output of a SQL query to an access file.. and i need help in doing it.

The query i have uses multiple databases and table and generates an output of 4 million rows.
Since Microsoft excel supports maximum of 1 million row, i have to create 4 excel files for the same..which is not acceptable by my client.
They want to see all 4 Million rows in a single file and excel does not support this.
Someone told me that I can use MICROSOFT ACCESS for doing so.
i.e. Direct the query output to access file.
I have never worked with ACCESS and dont know how to do it?
I tried to dig into the SSIS tool to find if that was possible, but i am still stuck.
Any help will be really appreciated.

Thanks,

Sequin
Starting Member

25 Posts

Posted - 2009-12-02 : 11:32:41
Create an empty Access database in a location of your choice - eg C:\temp\Destination.mdb

Open up SQL Server Management Studio, drill down to your source database, then right click on the database name and click on Tasks, then Export Data.....

Leave the first screen as it is (assuming you are on the correct source database), click Next.

Change the destination to "Microsoft Access" in the top combo box, then browse for the empty database you created earlier, then click next....

You can then choose a table/view as the source, or enter a query. It will suggest table names in the destination database - You can then choose to execute the query immediately, or save it as an SSIS package (usefull if you are to run it more than once)

Run the export and there you are!
Go to Top of Page
   

- Advertisement -