SSIS excel datatype issue
hi,
I have 2 questions:
when I am taking the data from Excel to SQL using SSIS
1) In my Excel one column have first 113 rows as blank and then it has numeric value this column is giving an error potential loss of data. So, I make the fist row as 0 and it worked fine. But, the data is entered
by the user in the future .. how can I resolve this issue with out entering 0 in the first row of the column .
2) In the same excel there are other 2 columns only fist 34 rows are blank .. they are working fine. how many rows will SSIS check to decide the column data type.
please advice
thanks
1) --> It happens because SSIS tries to identify the data type by just looking at first 8 rows and it finds that if it is blank then it assign some data type with less length and then in reality you have numbers and hence throws error.
Set IMEX = 1 in connection string.
Set TypeGuessRows setting to 0 from RegEdit.
HKEY_LOCAL_MACHINE -> SOFTWARE -> Wow6432Node -> Microsoft -> Jet -> 4.0 ->Engines -> Excel -> TypeGuessRows has the value 0.
2) --> By default it checks 8 rows. You may check above setting from Registry Editor.
Please refer:
http://blog.concentra.co.uk/2013/05/15/why-ssis-always-gets-excel-data-types-wrong-and-how-to-fix-it/
http://blogs.lessthandot.com/index.php/datamgmt/dbprogramming/mssqlserver/what-s-the-deal-with/
Cheers,
Vaibhav Chaudhari
[MCP],
[MCTS], [MCSA-SQL2012]
Similar Messages
-
SSIS excel connection datatype issue
HI
Please find data below
ColA ColB
74378 11213
312 21312
34 234
7329 27924
23423 224353
42342 13243
54245 32321
25423 6483
5234 84379
dmf 934293
52 9549
49 439879
ads asdf
asd aesdf
asd asdf
asd asdf
asdf asdf
sadf asdf
asdf sadf
Using excel connection to load data to SQL Server When I try doing this character data is loading as nulls, I have tried by putting IMEX=1 property in connection string and removing IMEX=1 property from connection string , in both cases it is showing nulls,
in the data viewer which i have placed after Excel source. I have also tried using the OPENROWSET which for some reason does not create an adhoc connection. I also tried changing the Datatypes in the advanced editor which again throws error. I tried all possible
ways of fixing this issue but no luck yet. Could you please help resolve this. For some reason SSIS excel connection reads only the first 8 rows and decides a datatype and rest showup NULL.The problem with your data is that Excel is attempting to guess the data type of the columns. By default, the TypeGuessRows property is set to 8, which means it will sample the first eight rows. In your data, the first eight rows are all numbers,
so Excel interprets the entire column as numeric. When it encounters text, it decides it can't convert text to numbers, so it provides SSIS with a NULL.
IMEX has no effect in the above scenario (with the default TypeGuessRows value) because IMEX applies when Excel finds "mixed types" in the columns - and in your case (with eight rows) it does not.
TypeGuessRows can be modified (as Reza suggested) but only for values from 0 to 16. In your specific case, setting it to 16 would have an effect. Excel would read your file, see some numeric AND text values, and decide those columns have "mixed
types". NOW the IMEX attribute comes into play. If you DON'T specify IMEX=1, then Excel will choose a data type based on majority wins. In your specific case, it would still choose numeric for column A and column B, because most of the values
in the first 16 rows are numeric. If you specify IMEX=1, then Excel behaves differently. Instead of "majority wins", if multiple data types are detected, it ALWAYS picks text.
So - in your specific case, with this specific file, increasing TypeGuessRows to 13 or more, AND using IMEX=1 will allow you to read both columns as text, and not receive NULLs.
Talk to me now on -
Export to excel - Formatting issue - OBIEE 11.1.1.5
Hi All,
When an analysis is exported to Excel, some of the values are showing some strange behaviour i.e. some values are multiplied by some huge number as you can see in the excel screenshot below.
BI Analysis Screenshot:
http://i44.tinypic.com/331eopf.jpg
Excel Screenshot:
http://i44.tinypic.com/34snqko.jpg
Is this BI issue or an Excel setup issue? And how to fix it?
Thanks in advance.Hi,
We too faced the similar issue.
We tried ROUND function and it was coming with proper formatting.
Try and let me know further.
Regards,
MuRam
NOTE: Please mention if this resolved your problem/still facing and close the thread to assist others with similar problems. -
Hi Guys,
I have a problem that when I export a BO report to Excel, the bar graph from BO gets very scrunched up and narrow, with the X-axis barely visible once it goes to Excel. But in BO, the report looks great. With all the cells aligned and matching. Is there a way to manipulate something in the BO report to make it Excel friendlier?
thanks in advance, will award points.
-preyaHi All,
Trying to replicate WEBI Excel Download issue.
Operating system : Windows 7
Internet Explorer : IE8 Version 8.0.7600.16385CO.
Jre Version : 1.6_ greater than 1.8 version.
If anybody having above specifications in your machines Please try to save a webi reports to excel format and send me the results. -
Saving BO reports in excel-time issue
Hi,
I am facing an issue when i try to save a BO6.5 report in the excel format.when Busines objects saves reports into excel the issue is that the time value in Business Objects varies completley and is incorrect.There is a time difference of 11 hours
Can anyone please advise me on this issue.
Cheers,
AnuHi,
Try to check your system time (local settings i.e control panel-> time....) is displaying correctly or not. As BO will take your local system date/ time in reporting.
Cheers,
Suresh Aluri. -
Excel saving issues error: Someone else is working right now, please try again later"
Excel saving issues error: Someone else is working right now, please try again later"
I am running W8.1 with Office 2013 and accessing a shared drive, When I try to save an excel document back to the shared drive - I get the error msg
"Someone else is working in "servername\share\filename" right now, please try again later"
I can see that there is no one else accessing this file at all. I created a brand new file, added content, saved and got the same error.
When I use a W7 with Office 2013 accessing the same share drive, accessing the same file - I am able to save the document without issues.
Does anyone have any ideas what this could be. Both of these situations are while working from home using a company vpn connection. It does not happen when in the office using either W8.1 or W7.
Peter.Hi,
Saves when saving locally. Its looking more like W8.1 on a VPN connection that is causing the issue. What can I look for
I mean you can try to save it to local drive(like drive c:) and then copy it to shared drive.
If you gain the access to the shared file server, you can check the file status when you open this file.
Also you can check your event log to see which process causes this error.
Since I'm not familiar with VPN, I'd suggest you post your issue to the following forum:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?category=windowsserver -
Hi All,
I have a SSIS pkg, I have
1. Sart_time (datetime datatype)
2. End_time (datetime datatype)
3. Run_time ( Time(0) datatype)
I am using the Run_time to get the difference of star & end time to calculate the time taken to complete the execution of pkg.
When I run the below query in Management Studio I am getting the desired result as below, however when ran through SSIS expression using Execute SQL Task to update this table, it is updating it to NULL, as I am having the same code in SSIS I was expecting
it give the the result.
select CAST(END_TIME - START_TIME AS TIME(0)) from Log_table
00:00:56
Regards
NeilHello,
Just as others post above, please try to use the DATEDIFF() function rather then minus operation. Please check the following statements:
SELECT CONVERT(time(0), DATEADD(ss, DATEDIFF(ss,Sart_time, End_time), 0))
Regards,
Fanny Liu
If you have any feedback on our support, please click here.
Fanny Liu
TechNet Community Support -
Excel data issue of string mixed with number or decimal
I have an excel file (.xls) from the client. The file only has one column Name. For some reasons, a couple of data are number or decimal (see the following example).
Name
abc
xyz
123
3.98
When I tried to import data to the table (mssql 2008) (one column with nvarchar(255)), I got the error:
The column status returned was: "The value violated the integrity constraints for the column.".
I had to open the file and added ' before the number or decimal
Name
abc
xyz
'123
'3.98
Although it worked this way, it is not a good way. Any good suggestions to do it without modifying the file? Thanks.
A Fan of SSIS, SSRS and SSASThat may be because you didnt set IMEX = 1
You have to set it to enable Excel to correctly determine data for intermixed datatypes
see
http://visakhm.blogspot.in/2013/01/excel-issues-in-handling-intermixed-data.html
http://blog.concentra.co.uk/2013/05/15/why-ssis-always-gets-excel-data-types-wrong-and-how-to-fix-it/
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Good day,
I am currently working on a SSIS package that had been built by a previous user. That Package allows me to import data from an excel source to a SQL table. The excel sheet holds multiple columns, However I am having difficulty with one
column when running the package.
The column rows hold a character and an integer (eg: N2). The data types are as follows:
SQL – varchar(3),NULL
SSIS - double-precision float [DT_R8]
I then inserted a data conversion task to change the data type. The task holds the following properties:
Input column – F6
Output Alias – Copy of F6
Data Type – string[DT_STR]
Length – 50
When I execute the package I receive the following error:”
[Excel Source Data [76]] Error: There was an error with output column "F6" (91) on output "Excel Source Output" (85). The column status returned was: "The value could not be converted because
of a potential loss of data.".
I do know that usually the message "The value could not be converted because of a potential loss of data." refers to a data type or length problem.
Further insight to this problem will be much appreciated.Hi Zahid01,
From the error message you post, we can infer the issue is caused by the input column “F6” cannot convert to the output column in Excel Source.
Based on my test, I can reproduce the issue in my environment. The exactly cause is the data type of input column “F6” cannot convert to the data type of corresponding output column. For example, the data type of input column “F6” is [DT_STR], the data type
of corresponding output column is [DT_I4], and there are some nonnumeric values in the input column “F6”. When we execute the task, the error occurs. We can verify the issue in the Advanced Editor dialog box of Excel Source. The following screenshot is for
your reference:
To avoid this issue, please make sure the input column can convert to the output column in Excel Source, including all the values in the input column.
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Hi All
I uploaded comma deliminated file through excel load wizard... after i successfully loaded , some rows are shown under "updated rows" category but actually thats the 1st time i uploaded.
All what i wanted is to insert all rows to the table.
Rows that are shown as "updated rows" are missing in table.
Could any one pls help me on this .
(Apex 4.1, Oracle 11g enterprise edition, pl/sql gateway configuration)
ThanksThanks Visakh. But it need a lot of change of SSIS package. Since Data conversion is available in Dataflow Task , and SCRIPT Task was used to read the data from EXCEL.
Only other way is to change it in excel source as far as i know
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
SSIS excel destination , data loads into header row
I have SSIS package
that is supposed to load data into excel destination (template file).
The destination has first row is Title , 2nd row has headers so I do as follows,
Select
* from [TemplateName$A2:$AD10000]
But what happens is it inserts first set of data (SQL source) into second row of template which contains header names and overwrites but if I select A3 istead,
it gives error since mapping needs column names.
Please suggest, thanksyou dont need to select range like this for that
What you can do is just select property column names in first row in the excel connection manager for that
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
SSIS Excel destination blank row
I have create an SSIS package in VS 2005 (because we are still in the stone age) where I have three Excel exports using the Excel Destination. One works fine but the other two have a blank first row each time (the second row of the sheet). I have reviewed
other threads but cannot seem to find a solution.
I do not have extra data in my templates. I even tried creating new ones but that didn't help. Pressing <CTRL><END> takes me the the first line where the header is.
There was one that looked promising but the selected answer referred to dead Microsoft forum link (forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2915256&SiteID=1).
Any suggestions to fix this?
Thanks for any help.I think it may be because of some unprintable characters present at the end of the excel header row.did you try explicitly setting a range to start from 2nd row for them and see if blank row disappears
http://sqlserversolutions.blogspot.in/2009/02/selecting-excel-range-in-ssis.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
FDM Excel Import Issue - Data not loading.
I cannot get an excel mappping table to load to FDM. I am working on the Entiy dimension. I noticed a few things when trying to trouble shoot this. If you delete a record, the excel file will load that one entity back to the mapping table with the changes from the excel file. Also, if I delete the table and load a new mapping table with excel it will add the first record. The only thing that changes on the new load is the data key. I could not find anything in the Oracle forum on this.
When you manually load this data you do not add the sequence number, which seems to be always zero , the data key, which seems to be incrementing itself some how(but not sequentially) , and the partion key and dimname , which appear to not change. I was assuming that the issue was in the way I was adding this other data. I am obviiously new to FDM, so any help would be much appreciated. Thanks!I am facing similar issue.
I am trying to map ICP Entries using an excel file.
I have made 2 mapping (explicit) entries, manually and exported it in Excel and then added all the Mappings in the same file, in proper format. when I am importing, I am not getting any error but the mapping is not getting updated and the new entries are also not getting added. so Ideally no Change in the tDatamap table.
Environment details: FDM Version 11.1.1.3 is getting used. Target App is Essbase 11.1.1.3. able to connect to Essbase, no issues with connectivity.
Has anyone face this issue. -
Webi XI report export to excel--- Formatting issue
Post Author: Sougata
CA Forum: WebIntelligence Reporting
We have WEBI report that contains cell with hyperlink. The value of the cell in numeric. Type is string.
When we export this report to excel. In, Excel version is MS-office Excel 2003. In excel it is showing those green with Error --- "NUMBER STORED AS Text".
Any solution?Hi Steve,
As per my understanding, the issue occurs because Excel Destination gets the data from the source. We can change it, but once it re-validates it will change it back. This makes sense since we cannot change the data type in the actual table. To work around
this issue, I suggest that we can add a data conversion or derived column to explicitly cast the values.
Besides, the suggestion post by Arthur means that we can add IMEX=1 to the value of Extended Properties in the connection string of the Excel connection manager in the Properties window to specify Import Mode. For more details about the settings of IMEX,
please see:
https://support2.microsoft.com/kb/194124?wa=wsignin1.0
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Export to Excel - Formatting Issues
I am using Crystal XI and Excel 2010.
I have created a report that is Letter size and Landscape orientation. I export it to Excel and, when I open it in Excel, the columns seem to look ok, but the segmens that are in the Report Headers (there are two) are stretched way out to the right so that printing causes two pages to be printed with the second page containing the fields that were located on the right edge of the report's headers.
The title banner is also shifted so that, where it is centered on the report, it is now almost right aligned on the first page of the Excel sheet.
The Page Header, Footer and Detail sections appear to be correct.
I tried a redesign changing it to Portrait orientation and this (sort of) fixes the headings (when Excel is set o print in Landscape), but the Page Header, Footer, and Details sections are squeezed up to a third of the page width.
I'm accepting all defaults for the export, and the Report Headers re required (ie, exporting data only is not an option).
Is this a known issue, or is it something I'm not doing right?
TIAwhen you export the data, do you have an option for excel data only?
Yes I do. It's labeled "Microsoft Excel 97-2000 - Data only (XLS)
when you click on the export
select to application, i believe that is the only time you get the options.
No, the options will also appear when you select "Disk file" as the Destination. But neither way works as advertised.
to next step select options
when you select the options it drops down
on the bottom you have boxes on the left and right
Yes, but, while there are four check boxes on the left ("Export object formatting", "Export images", "Use worksheet functions for summaries", and "Maintain relative object position"), there are only three on the right ("Maintain column alignment", "Export page header and page footer", and "Simplify page headers")
I tried checking 1, 2, and 4 on the left and 1, 2, and 3 on the right. No joy.
Just now tried checking 1, 2, and 4 on the left and 1 and 2 on the right. Also no joy.
Maybe you are looking for
-
Slow shutdown, restart, logout on MBP retina 10.9.3
I have been unable to shutdown or restart my MBP mid 2012 retina (2.6 GHz Intel Core i70, other than by holding down the power button. I've tried, I think, almost all suggestions on this forum (safe mode, restore, repair permissions reset PVRAM. etc
-
I'm running maverick and iPhoto 09 (8.1.2 build 4.2.4). I have 2 photo libraries. (45GB and 28GB) Thinking of upgrading to yosemite osx. Tried to update the iPhoto to version 9.6 but it says "iPhoto can't be installed on "Macintosh HD" because OS X
-
Changing input without creative
I want to change e.g. from Line-In to Auxiliary. Is it possible to do this via batch or VB or w/e, just outside of the creative program so I can do it with one click?
-
Hello, I have a table "XXDUMMY" with a column "F1". Right now, When I do a "select * from XXDUMMY", I get the following... F1 4444089014 DGV3142004 5JN430151I 7JN430151I 9JN430151I JN430151ID I want to order by (sort) the results so that I get rows w
-
i brought a macbook pro last week! 15.4" 2.6ghz 8gb ram 750 hd ITS 2012 EDITION !! I JUST WANTED TO KNOW THE STARTUP AND THE TURN OFF TIMING !!! PLZ HELP ME !!!