SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Data into Excel Cells?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

79 Posts

Posted - 12/11/2012 :  15:19:07  Show Profile  Reply with Quote
A user has an excel document and there are 5 specific cells they need to populate. The data is in one of our SQL databases. Is it possible to create a new copy of that excel doc with those fields populated for each record? There are around 2000 records they don't want to manually populate each one.

I have never tried this before so not even sure if this possible or not.

Flowing Fount of Yak Knowledge

2240 Posts

Posted - 12/14/2012 :  05:54:29  Show Profile  Reply with Quote
Do you mean that insertion of table data into an excel file?

Go to Top of Page

Very Important crosS Applying yaK Herder

52325 Posts

Posted - 12/14/2012 :  06:00:07  Show Profile  Reply with Quote
you can write a disributed query based on OPENROWSET for updating those excel cells from SQL server.



SQL Server MVP

Go to Top of Page

Flowing Fount of Yak Knowledge

United Kingdom
2138 Posts

Posted - 12/15/2012 :  11:36:17  Show Profile  Visit jackv's Homepage  Reply with Quote
You can complete this task using Powershell - which lets you reference\instantiate the Excel doc - and also specifically focus on certain cells.
You can also connect to the SQL Server Instance - execute the query - and place in the cells above.
Check the Excel COM object and the New-Object ('Microsoft.SqlServer.Management.Smo.Server') to connect to the SQL Server Instance

Jack Vamvas

Edited by - jackv on 12/15/2012 11:39:21
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000