CraigLazar
asked on
SSIS Expression problem
Hi
I am battling to pass an expression in a variable
in SSIS driving me nuts
i have a simple select statement and one of the fields is s numeric (10.0)
I have a variable in SSIS which i want to use as part of the WHERE clause on this numeric field but i keep getting the following error
>>AND TCMSourceSystemID =" + @[User::TCMSourceSystemID] + "
"Data Types DT_WSTR and DT_R8" are incompatible for binary operator +
thanks
"
SELECT TCMSourceSystemID, SourceCustID FROM " + @[User::TargetSchema] + ".TCMStdCustomerMapSourceM ULTI
WHERE TCMBusinessDate = '" + @[User::TCMBusinessDate] + "' AND TCMSourceSystemID =" + @[User::TCMSourceSystemID] + "
"
I am battling to pass an expression in a variable
in SSIS driving me nuts
i have a simple select statement and one of the fields is s numeric (10.0)
I have a variable in SSIS which i want to use as part of the WHERE clause on this numeric field but i keep getting the following error
>>AND TCMSourceSystemID =" + @[User::TCMSourceSystemID]
"Data Types DT_WSTR and DT_R8" are incompatible for binary operator +
thanks
"
SELECT TCMSourceSystemID, SourceCustID FROM " + @[User::TargetSchema] + ".TCMStdCustomerMapSourceM
WHERE TCMBusinessDate = '" + @[User::TCMBusinessDate] + "' AND TCMSourceSystemID =" + @[User::TCMSourceSystemID]
"
ASKER
Hi,
i cannot as it is numeric in the database, so not sure why i am getting this error
i cannot as it is numeric in the database, so not sure why i am getting this error
You are using string concatenation to create your sql-statement, so everything has to be text to be concatenated with the rest of the statement. You can and should convert!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks will give it a try
ASKER
thanks got it going
... + cast(@[User::TCMSourceSyst