Store SQL server varchar max in SSIS string [dupli

2019-02-15 20:32发布

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 ?

2条回答
Lonely孤独者°
2楼-- · 2019-02-15 21:11

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

查看更多
再贱就再见
3楼-- · 2019-02-15 21:24

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();

查看更多
登录 后发表回答