Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store SQL server varchar max in SSIS string [duplicate]

What i am doing -

Get single row result set from execute sql task (EST) via oledb connection (OLE).

I want to set ssis variable strName = row's 1st column value (a varchar max). strName is a ssis string FOR SURE. I checked.

In EST - result name = 0, variable name = User::strName.

I get the error -

[Execute SQL Task] Error: An error occurred while assigning a value to variable "strName": "The type of the value being assigned to variable "User::strName" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.

How do I fix this ?

like image 391
Steam Avatar asked Jul 30 '26 11:07

Steam


2 Answers

The problem is SSIS doesn't understand varchar(max) as a data type .You need to specify the limit . CAST the varchar(max) column to varchar(8000) to solve the problem. Or you can store the VARCHAR max into a SSIS object and then get the value using object.ToString();

like image 129
Steam Avatar answered Aug 02 '26 02:08

Steam


Use an ADO.NET connection. OLEDB cannot cope with varchar(max).

like image 39
Ruud de Boo Avatar answered Aug 02 '26 01:08

Ruud de Boo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!