SSIS problem deploying package on SQL Server 2012 - excel

I want to ask what the problem may be. I run the ssis package on my computer, where I export data from Oracle to Excel and everything works. But when I deploy this package to my SQL Server 2012 machine, the package reports an error:
Column "xx" cannot convert between unicode and non-unicode string data types.
My package looks like this:
It's very simple, and on my PC everything works.
I understand that if I probably add data conversion in the package, it will fix the error. But I'm more interested in why this is the case for me and not on the server?

The error occurred during the last stage, but I didn't get it. I selected 4 columns from Oracle and inserted them into Excel in DT_WSTR format, so I didn't know why it reported an error with converting between non-Unicode and Unicode. I resolved this error as follows:
ValidateExternalMetaData: False

Related

pyodbc fetchall() returns no results when a column returned by the query contains too much data

Setup:I am using Python 3.3 on a Windows 2012 client.
I have a select query running using pyodbc which is not returning any results via fetchall(). I know the query works fine because i can take it out and run it from Microsoft SQL Management Studio without any issues.
I can also remove one column from the select list and the query will return results. For the database row in question, this column contains a large amount of XML data (> 10,000 characters), so it seems as though there is some buffer overflow issue going on causing fetchall() to fail, though it doesn't throw any exceptions. I have tried googling around and i have seen rumors of a config option to raise the buffer size, but i haven't been able to nail down exactly how to do it, or what a workaround would be.
Is there a configuration option that I can use, or any alternative to pyodbc.
Disclaimer: I have only been using python for about 2 weeks now so i
am still quite the noob, though i have made every attempt to research
my problems thoroughly this one has proven to be elusive:
On a side note, i tried using odbc instead of pyodbc but the same query throws this oddball error which google isn't helping me solve either
[ERROR] An exception while executing the Select query: [][Negative size passed to PyBytes_FromStringAndSize]
It seems this issue was resolved by changing my SQL connection string
FROM:
DRIVER={SQL Server Native Client 11.0}
TO:
DRIVER={SQL Server}

SQL CE 4.0 Error - ReleaseHandleFailed was detected

I keep getting this error in the dev environment - 'A SafeHandle or CriticalHandle of type 'System.Data.SqlServerCe.HasSafeHandle' failed to properly release the handle with value ...."
It is in a VS 2012 Winforms application and only seems to happen if a particular piece of code is run at some point. The error shows after the form is closed, but I can't understand why. It only happens in the dev environment and seems to be OK in the compiled version, but I don't want to just ignore it.
The error seems to be caused by this line of code, although weirdly at this point in time I have not opened a connection to the SQL ce database and the directory it is searching in does not have the SQL ce database in it. It is mearly reading in txt files that match a pattern
string[] fileNames = Directory.GetFiles(importDirectory, "BucketHistory*.txt")
I'll do some more digging tomorrow, it's late now, and I have no idea what is causing it.
Any pointers ??!
Turns out I was having a bit of brain fade yesterday. Been working too long hours !
For anyone interested, the problem was that I was opening a connection, then copying the file and running a shrink whilst the connection was still open. It had nothing to do with that line of code.
I would have expected the copy to have thrown an exception, but it didn't appear to. Oh, and opening another connection inside the using statement of the first one. Sigh.

SSIS input column [Column] and reference column named [Column] have incompatible data types in server alone

My scenario is I upload an excel and take a column [ColumnExcel] in excel which is of type DT_WSTR and compare lookup that with a DB2 field[ColumnDB2] which is of type CHAR(9). I convert the DT_WSTR into DT_STR type and do the lookup. I execute this package via C# code and works perfectly fine in my local machine but it doesn't work and gives an error
"input column [ColumnExcelConverted] and reference column named [ColumnDB2] have incompatible data types."
in production machine.
1) My system has BIDS 2008 but in production it does not have BIDS but has Execute package utility of SQL server 2008 R2.
2) Also the driver in my system is IBM DB2 ODBC driver 8.01 while in production it is IBM DB2 ODBC driver 9.01.
What could be the problem and solution. I am still unable to find the exact cause.
The issue is most likely your differing versions of your ODBC driver.

Excel export works locally, fields become hidden when running on server

OK, so i have a SmartGWT web application, where i have some reports running in list grids.
I export to excel using the Smartgwt built-in export as per the examples using the listgrid.exportclientdata();
Here's the issue:
-When running locally, all works fine and i can open the XLSX file and see all data.
-When running from the server, the columns containing data become hidden! If i manually do the "unhide" thing from within Excel, i can see the columns...
My local environment is Mac OSX, Mountain Lion(also tried earlier), running Sun's Java.
The prod server is Debian running OpenJDK.
Not sure if that would have something to do with it, and i am at a loss as to how i go about solving it... Running my webapp on Tomcat6 in both environments.
For others, searching the stackoverflow void for answers to riddles in the dark:
This was caused by certain fonts not being available in OpenJDK, without any errors being logged anywhere...
I switched to Sun's JDK on my Debian as well, and the Excel files now open and display properly.
This an also happen when facing this POI Bug that seems to be related to a Java Bug.
If it's the case changing the Font to something other than Calibri or using jre above 7u21 should fix the issue.
You can also mitigitate the issue and avoid the columns from being totally collapsed by using a code like this
sheet.autoSizeColumn(x);
if (sheet.getColumnWidth(x) == 0) {
// autosize failed use MIN_WIDTH
sheet.setColumnWidth(x, MIN_WIDTH);
}

Compile error when running on another machine

I am having a problem with a workbook. It works fine on my machine but when it is run by someone else it is giving a problem with an error message "Compile error can't find project or library"- thing is, it is doing it on a Mid$ string command!
Anyone know what could cause this? Is there a setting they need somewhere? The code was written in Excel 2010 and they are running Excel 2010
This is caused when you have a missing reference. Have a look in Tools > References on the machines that are throwing the error. You should see that certain references are prefixed with MISSING.
These libraries will need to be installed on the other machines in order to use them, alternatively, you could try late binding if they have an earlier version of the reference you are using.
If the above doesn't work, I have experienced this problem when there is a failed installation on the machine. None of the references are missing, but upon opening Excel a (usually unrelated) application gets stuck in a failed install loop. If this is what is happening, you'll need to rectify the failed installation.

Resources