check if object isnull or not


  • hi all please see attached image.  I'm trying to add a precedence constraint to check to see if any emails are found or not.  If emails are found, carry on, if not check sftp file location (we can receive files by both email and sftp).  ISNULL does not work with object data type so how do i get around this??? Thanks!

    I'm using cozyroc receive email task which outputs a result variable as object

    ISNULL( @[User::MailList]  ) if true check folder location if false carry on with exchange tasks...

    hmm... image upload isn't working...

    • Edited by jhowe1 Thursday, July 04, 2013 3:46 PM edit
    Thursday, July 04, 2013 3:36 PM

All replies

  • You cannot use object variable in precedence constraint. You need to iterate through the object variable and save the iindividual value in a string variable. Then use string variable in precedence constraint

    Nitesh Rai- Please mark the post as answered if it answers your question

    Thursday, July 04, 2013 3:40 PM
  • The easiest way would probably be to use a script task. This excellent blog post explains how:
    Read a DataSet From Variable In a Script Task

    Load the object variable in a datatable and do a simple count on this table. (use the Rows property)

    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

    • Proposed as answer by V Karthik Friday, July 05, 2013 8:48 AM
    Friday, July 05, 2013 8:12 AM
  • hi let me clarify on what I was trying to do... get an email list (if no emails check folder location), iterate through get attachments, decrypt or encrypt import data into staging tables. 

    Tuesday, July 09, 2013 1:29 PM