I have a requirement of inserting a hardcoded string value into table which is having column as varchar(100).
I have few more fields to insert that is coming from flat file and for inserting harcoded string I have used "Derived Column" component in SSIS.When I am mapping my derived column to varchar column in table ,I am getting an error "Cannot convert unicode to non-unicode string ". I am wondering if there is any way I can convert this column to non-unicode string.
Please help and suggestions are welcome.
The only difference between the Unicode and the non-Unicode versions is whether OAWCHAR or char data type is used for character data. The length arguments always indicate the number of characters, not the number of bytes.
The Data Conversion transformation converts the data in an input column to a different data type and then copies it to a new output column. For example, a package can extract data from multiple sources, and then use this transformation to convert columns to the data type required by the destination data store.
By default Excel data is treated as Unicode and also by default when you create new tables SQL Server will make your character type columns Unicode as well (nchar, nvarchar,etc...)
you can achieve this without explicit conversion by right clicking on the derived column component and selecting 'show advance editor'. Then 'Input and Output Properties' > 'Derived Column Output' > 'Output Column' > your column; then you can set the data type property to DT_STR.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With