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)
 Expression Problem

Author  Topic 

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2008-07-22 : 11:17:09
Hi Guys

I'm having a problem when entering an expression for a subject in a send mail task.

I am using the following expression:

"Order Extract Sucess" +" "+ @[User::vRowCount] " Rows"

But get the following error:

TITLE: Expression Builder
------------------------------

Expression cannot be evaluated.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%u00ae+Visual+Studio%u00ae+2005&ProdVer=8.0.50727.867&EvtSrc=Microsoft.DataTransformationServices.Controls.TaskUIFramework.TaskUIFrameworkSR&EvtID=FailToEvaluateExpression&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

The data types "DT_WSTR" and "DT_I8" are incompatible for binary operator "+". The operand types could not be implicitly cast into compatible types for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

Attempt to set the result type of binary operation ""Order Extract Sucess" + " " + @[User::vRowCount]" failed with error code 0xC0047080.

Does anyone know what I could do, the @[User::vRowCount] is an integer.

Thanks

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2008-07-22 : 13:35:08
"Order Extract Sucess" +" "+ @[User::vRowCount] " Rows"
to
"Order Extract Sucess" +" "+ @[User::vRowCount] + " Rows"
or
"Order Extract Sucess " + @[User::vRowCount] + " Rows"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-22 : 14:03:47
quote:
Originally posted by rcr69er

Hi Guys

I'm having a problem when entering an expression for a subject in a send mail task.

I am using the following expression:

"Order Extract Sucess" +" "+ @[User::vRowCount] " Rows"

But get the following error:

TITLE: Expression Builder
------------------------------

Expression cannot be evaluated.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%u00ae+Visual+Studio%u00ae+2005&ProdVer=8.0.50727.867&EvtSrc=Microsoft.DataTransformationServices.Controls.TaskUIFramework.TaskUIFrameworkSR&EvtID=FailToEvaluateExpression&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

The data types "DT_WSTR" and "DT_I8" are incompatible for binary operator "+". The operand types could not be implicitly cast into compatible types for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

Attempt to set the result type of binary operation ""Order Extract Sucess" + " " + @[User::vRowCount]" failed with error code 0xC0047080.

Does anyone know what I could do, the @[User::vRowCount] is an integer.

Thanks




The error message clearly suggests how to resolve it. the var @[User::vRowCount] is of type int so cant be concatenated with string value. so cast it to string and then concatenate.

something like


"Order Extract Sucess" +" "+ (DT_WSTR) @[User::vRowCount] + " Rows"
Go to Top of Page

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2008-07-23 : 04:09:12
Hi

Thanks for that, but I still getting the same error.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-23 : 05:07:52
quote:
Originally posted by rcr69er

Hi

Thanks for that, but I still getting the same error.


whats the type of variable used?
Go to Top of Page

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2008-07-23 : 07:14:14
Hi

Its an int32 type.
Go to Top of Page

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2008-07-23 : 10:05:13
"Order Extract Sucess" +" "+ (DT_WSTR,10)@[User::vRowCount] + " Rows"
Go to Top of Page

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2008-07-23 : 10:46:06
Hey

Thanks for that, it worked GREAT!!!
Go to Top of Page
   

- Advertisement -