|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 8:11 AM
Points: 5,
Visits: 332
|
|
I have an excel file which contains first ten rows with information about that excel and the actual data from 11th row.In the Actual Data i have few columns with Custom formatting (#,##). My problem is when i read the data from excel using SSIS, i am not able to get the decimal values. For example, one row i have actual value as 1.009876 but the formatted value shows it as 1. I need to retreive the complete decimal value. I am using IMEX=1. Since excel is not installed in my db server, i cant use microsoft.office.interop.excel. any suggestions will be highly appreciated
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: 2 days ago @ 6:54 AM
Points: 9,364,
Visits: 6,462
|
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: 2 days ago @ 5:12 AM
Points: 4,226,
Visits: 9,458
|
|
Note also that custom formatting in Excel has no effect on the data which is stored or extracted - it is a display format effective only in the Excel application.
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 8:11 AM
Points: 5,
Visits: 332
|
|
Thanks for the replies. I will make the changes in the registry and try it. Hopefully my admin will allow it
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 8:31 AM
Points: 917,
Visits: 399
|
|
Seeing as I am back in the painful world of Excel....
Try using a OLE connection to the file, add "EXCEL 8.0;IMEX=1;HDR=No" in the extended properties and select from the connection using a SQL connector.
All your outputs will be Nvarchar but the full values.
Depending on how "clean" your data is, Excel might be kind and give back all your rows. if it is feeling like an @rse, it'll keep giving you grief...
I'm in the grief stage ATM.
But as Phill said - front end formatting is just that, formatting... HTH
CP
Cheers, Crispin
I can't die, there are too many people who still have to meet me!
It's not a bug, SQL just misunderstood me!
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 8:11 AM
Points: 5,
Visits: 332
|
|
| Could you please elaborate the steps?. I am sorry for the trouble..i am not able to follow it...
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 8:31 AM
Points: 917,
Visits: 399
|
|
Sure,
1) Create a OLE DB connection. 2) Provider is Microsoft JET (note, this will only work on x86 machine or package running as x86) 3) Set filename to be full path to xls file. 4) user and pass remain default (are actually ignored and cannot be used for xls) 5) Click on All, scroll up to Extended Properties. paste in options I mentioned. 6) Close 7) In data flow, create new OLE DB Source 8) Choose the connection you've just created. 9) Select tables to see what sheets you have exposed. 10) Change from table to SQL query. Select F1, F2, F3 etc from [myworkbook$] 11) Click ok. 12) Add rest of components (a union all as a consumer to test with) 13 Run 
Cheers, Crispin
I can't die, there are too many people who still have to meet me!
It's not a bug, SQL just misunderstood me!
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 8:11 AM
Points: 5,
Visits: 332
|
|
| I tried it. i have oledb connection with the provider (native oledb\microsoft jet 4.0 oledb provider). i have mentioned the complete path of the xls file. but i am getting the error saying "unrecogized databae format". am i missing something...
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 8:31 AM
Points: 917,
Visits: 399
|
|
Is the file and xls (i.e. not excel 2007/2010) file? have you put "EXCEL 8.0;IMEX=1;HDR=No" in the Extended Properties? (No quotes)
Cheers, Crispin
I can't die, there are too many people who still have to meet me!
It's not a bug, SQL just misunderstood me!
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 8:11 AM
Points: 5,
Visits: 332
|
|
it is 2003 excel file. yes i gave without quotes. Later, i tried by renaming the excel file from xls to xlsx but i am getting the error as "Could not find installable ISAM"
|
|
|
|