Welcome to blogs.conchango.com Sign in | Join | Help

Welcome to blogs.conchango.com

Steve Wright's Blog

SSIS Execute SQL Task With VARCHAR(MAX)

While I was using the SSIS Execute SQL Task to return a single row result I getting the following error:

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

This was happening becuase I was trying to assgin a varchar(max) result column to SSIS string variable.

There are two ways to solve this problem; one is to change the SSIS variable to object and convert each time it used to a string; the second way to solve this is to cast result column to max size limit.

 

Published 20 January 2006 17:41 by steve.wright

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

prachinsoparkar said:

Same things happend with me.

I had created a sp which returned @message varchar(max).

The SSIS parameters was defined as string.

If gave the same error.

But what i found out, was that it woked perfectly fine on 32 bit enviornment and gave that error on 64 bit enviornment.

June 19, 2008 11:38

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Personal Edition), by Telligent Systems