Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 execute sql task

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-01-23 : 10:11:54
Phil writes "I have a simple question. My scenerio is that I would like to read a column from a table in a SQL database in the Execute SQL Task in SSIS. I would like to assign the value of that column (which is a nvarchar(50) column) to a variable.

The issue I'm having is that unless I make the variable's data type an "object" I am getting the:

"The type of the value being assigned to variable "User::output_location" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object."


error.

I've checked profiler and verified the call is getting to the database. Why can't I populate a nvarchar column to a string data type variable?


Thanks,
Phil"

MuadDBA

628 Posts

Posted - 2007-01-23 : 11:44:29
Try using a wide string data type?
Go to Top of Page

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2007-01-23 : 12:37:45
What's the value of the ResultSet property in the General tab of the Task Editor? Is it set to "Full result set"? It sounds like you're trying to initialise a string variable with a resultset...

Mark
Go to Top of Page

tacket
Starting Member

47 Posts

Posted - 2007-01-23 : 15:29:21
To answer mwj - where is wstr in the variable data type list? I only string.

To answer crzjoe - it's single row.
Go to Top of Page
   

- Advertisement -