Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple rowcount package

Status
Not open for further replies.

MicheleWeaver

Programmer
Jul 11, 2006
14
US
I want to do a simple package that will send an e-mail if the rowcount of a query is > 0.

I add the rowcount data flow component and assign a variable cnt.

In the precendence constraint I add the expression @cnt > 0.

When I run, I get the error The expression "@cnt > 0" must evaluate to True or False.

Please help!
 
Do you have the @cnt variable defined as a Package Level variable or is it defined at the Data Flow Component level?
 
You need to add the variable at the package level.

Select anywhere on the designer of the Control Flow and select Variables from the SSIS menu. Click the Add Variable Toolbox item and enter the variable cnt and type here.

Delete the variable from the Data Flow Level.

In the RowCount task of the Data flow specify the VariableName as User::mad:cnt

The expression should work correctly now. You may need to key it in again.

Good luck.
 
Sorry - one correction...

The VariableName value should be User::cnt (without the @ sign).
 
I couldn't get it to save with User:: in front, but chaning the scope worked perfect. Thank you!!
 
The User:: prefix isn't really required unless you use the same name as a System variable. I use it just for clarity.

Glad to hear it worked!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top