SHIKO


Hello People,

I'm using SSIS and I want to send a report to the admin about how many rows are new, updated or unchanged in a mail. Everything is working fine except that the values that are sent are always zeros. I'm using a Row Count Transformation and configuered it to update the approperiate User Variable which I priviously created. However, the initial values in these variables are always Zeros. What can I do

Thanks,

SHIKO





Re: Updating the variable's value

Phil Brammer


Make sure the variables are of package level scope, and not data flow scope.







Re: Updating the variable's value

SHIKO

Yes, they are of the package level scope..







Re: Updating the variable's value

Phil Brammer

If the send mail task happens after the data flow that contains the row count transformations, then the variables should be populated correctly. Unless you have another set of variables at the data flow scope level with the same name as the package-level variables.






Re: Updating the variable's value

SHIKO

Thanks for your fast replies..

However, yes the send mail task happens after the data flow. I even didn't create except three user defined variabes of type Int32 and the initial values are set to Zero. Therefore, it can't be a confusion of names by any means, which is driving me crazy! What do you think this might be ! Another interesting peice of information is that the send mail task generates some error and gets red; however, the mail is sent!! Does this affects the values of the variables anyhow

Thanks in advance..






Re: Updating the variable's value

Phil Brammer

The initial value of the variables won't change. Only during runtime will they pick up the correct values and pass them off to the send mail task. When the process is done running, the variables will still show the initial values (0) that you gave them at run time.

What is the error of the Send Mail task






Re: Updating the variable's value

SHIKO

OK fine.. Then why the values that are passed at run time are always Zeros !

As for the mail task errors they are as follows..

(1) Error: A truncation occurred during evaluation of the expression.

(2) Error: The expression ""Hello Admin...\n"+ "======================================\n"+ "Package Name:\t" + @[System:Stick out tongueackageName] + "\n" + "Username:\t\t" + @[System::UserName] + "\n"+ "MachineName:\t" + @[System::MachineName] +"\n" + "======================================\n" + "New Records :\t\t" + (DT_STR,1,1252)@[User::NewRecords] + "\n"+ "Updated Records :\t\t" + (DT_STR,1,1252) @[User::ChangedRecords] + "\n"+ "Unchanged Records :\t" + (DT_STR,1,1252) @[User::UnchangedRecords] + "\n"+ "======================================\n"" on property "MessageSource" cannot be evaluated. Modify the expression to be valid.

which is a little bit weird because the expression is evaluated correctly in the wizard right away and produces the correct output which is like this

Hello Admin...

======================================

Package Name: smart

Username: ITWORX\Sherif.Magdi

MachineName: SALIM-XP4906

======================================

New Records : 0

Updated Records : 0

Unchanged Records : 0

======================================

I appreciate your help so much..






Re: Updating the variable's value

Phil Brammer

One thing to note: Are you sure that the variables can only contain the values 0-9 You are casting those variables to a string of length 1.




Re: Updating the variable's value

SHIKO

yes! that's what I noticed later. The type cast was not the right one to use. I used another type and it worked fine. It even made the variables be updated and the mail was sent correctly. Thanks a million for your pricious help.

SHIKO






Re: Updating the variable's value

EWisdahl

don't forget to mark posts as answered....






Re: Updating the variable's value

SHIKO

OK :-)