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
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Import data from SQL to Excel

Author  Topic 

Aguinee
Starting Member

1 Post

Posted - 2011-07-28 : 05:15:02
Hi,

I'm relavively new with SQL so I was wondering if someone could shed some light on a problem I'm having.

In my company we store almost all our data on SQL and this is the place where information is first updated. We also use excel templates for certain tasks within the company. These templates use information that is in our SQL databases. Our current process is that we copy and paste data from SQL into a worksheet in these templates and us excel code to then extract the info we need onto the output worksheet.

I want to speed this process up and remove the need for manual copying and pasting so I was wondering if it is possible to create some sort of querey/link so that when an excel sheet is opened up, it would automatically update certain fields from SQL. If this isn't possible I wanted to get something as close as I can to such an operation. I was told to look up ODBCs but so far I can't find anything specific to my question.

I am running excel 2007 and sql 2008.

edit: moved to proper forum

Any help would be much appreciated!

LearningSQL2
Starting Member

10 Posts

Posted - 2011-07-28 : 13:27:30
I'm also fairly new to SQL, and have the same version of Excel and SQL installed and am working on almost the exact same problem. I've had some luck using the Import/Export wizard on Excel to set up a permanent connection between the two programs. If you get onto Excel,
Select the "Data" bar on the top of the screen, click on the "From other sources" button, then select the " From SQL Server" on the scroll-down menu. From there, select your server (create on in SQL if you don't have one already), decide whether to use with SQL or Windows certification, wait a moment for the computer to process, then select the database you want to use, and specific table(s) you want Excel to connect to. If no error box comes up, you should have a connection between your Excel spreadsheet and your SQL database. Make sure you disable any security settings that might prevent the programs from connecting with each other This process seems to work fairly well for the most part and once is connection is established, it is much quicker than cutting and pasting.
Hope this helps.
-MTD
Go to Top of Page
   

- Advertisement -