|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 9:30 PM
Points: 912,
Visits: 198
|
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 2:11 AM
Points: 9,377,
Visits: 6,473
|
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 2:37 PM
Points: 73,
Visits: 273
|
|
| Thanks for the article. It seems way too common to get data 1) in Excel (ugh) and 2) completely formatted with no usable way to extract the data. I usually tell users to put the data in columnar format. Now I guess there are other options, but I'm not sure I am going to tell them that...;O)
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, June 27, 2010 1:07 AM
Points: 6,
Visits: 17
|
|
Hi I have a question what if there is picture in the excel file how do you pick the picture from the file. Can you shed some light on it.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, April 18, 2012 3:15 AM
Points: 6,
Visits: 221
|
|
Hi there,
nice article. Will bookmark it ;)
The only thing that comes up to my mind is that using excel on the server even through the assembly is never a good idea, since there is no way to debug and errors cannot be seen. Instead use something like syncfusion or so.
Rgds
Daniel
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Yesterday @ 1:00 PM
Points: 195,
Visits: 1,252
|
|
Thank you Dinesh. If it comes to read individual cells I think it is much easier to use Excel, VBA, ADO and SQL . I do have of code examples if anybody is interested.
//Gosta
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Monday, June 11, 2012 8:59 PM
Points: 88,
Visits: 33
|
|
Hi There,
Nice article, I will look at using this in future
previously, I have used the ACE driver to access Excel in the past with pivots to switch the data between rows and columns, the benefit of using the ACE driver is that you can link the queries etc to other SQL statements. also you only need to install the ACE driver on the server and not the Excel runtime - an element that many of the server admins that I have worked with didn't want on their servers.
Also with the ACE or OLEDB jet providers, you can specify specific cells and tabs within a spreadsheet.
below is my query that returns the same result as the one the article
select a.[Customer Name], a.[Address], a.[Sales Rep], b.[Order Number], b.[Order Date] from ( select [Customer Name], [Address], [Sales Rep] from (SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0 Xml;HDR=No;Database=C:\Projects\KPI Demo\IT 2009 Tester.xls;IMEX=1', 'SELECT * FROM [Department Details$A3:B5]')) as sourcetable PIVOT (MAX(F2) for F1 in ([Customer Name],[Address],[Sales Rep]) ) as PivotTable) a cross join ( select null as [Customer Name], [Order Number], [Order Date] from (SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0 Xml;HDR=No;Database=C:\Projects\KPI Demo\IT 2009 Tester.xls;IMEX=1', 'SELECT * FROM [Department Details$D3:E4]')) as sourcetable PIVOT (MAX(F2) for f1 in ([Order Number],[Order Date]) ) as PivotTable) b
Regards Warren
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 7:32 AM
Points: 11,
Visits: 54
|
|
Hi - does this work with 64-bit editions of SQL Server? I found much to my frustration that it wasn't possible to set up a spreadsheet as a linked server in SQL2005-64, and my investigation at the time only found the solution of going via a 32-bit SQL Server installation, which isn't great.
Just wondered if this could be another way round the problem.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 9:30 PM
Points: 912,
Visits: 198
|
|
yes this is working in 64 bit. in fact, all my development are happening in 64 bit
My Blog: http://dineshasanka.spaces.live.com/
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 7:32 AM
Points: 11,
Visits: 54
|
|
| That's excellent - thanks for posting - look forward to trying it out.
|
|
|
|