IS Package to split a SQL File into multiple csv files using a parameter. Getting cannot be applied error

  • How to explain.

    I have a SQL table

    SELECT School_Name, Dfe_No,PIN_For_Schools

    FROM dim.SWF_Schools

    I then Have a SQL Task which Creates a list of DFEE numbers as a full result set.

    In the result set tab Result Name 0 Variable Name User::CreateVariable (System object)

    Next this feeds into a Foreach loop container. In collection the ennumerator is Foreach ADO Enumerator

    The Ado Object source variable is User::CreateVariable

    Next tab is the variable Mapping. User:Sch_DFEE Index 0

    Now inside the Foreach loop is a data flow task.

    The source is the OLE DB Data source and it has been set using a query.

    SELECT ISNULL(School_Name,'') AS School_Name,

    ISNULL(Dfe_No,'') AS Dfe_No,

    ISNULL(PIN_For_Schools,'') AS PIN_For_Schools

    FROM dim.SWF_Schools

    WHERE Dfe_No = ?

    ? is the parameter If you click on Paramters you can see its @SCH_DFEE

    And now to the Namming Convention for the csv files.

    In the Flat File destination I have used an expression of @[User::SCH_DFEE]+"_Dfe_SecureAccessCredentials" to set the file Name.

    Runing the package doesn’t even get past the forEachLoop.

    I get the error

    Error: ForEach Variable Mapping number 1 to variable "User::SCH_DFEE" cannot be applied.

    And I cant find any decent information on where I have gone wrong. Any help would be greatly appreciated.

    Debbie

  • What is the data type of User::SCH_DFEE?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I set it up as a string as its a varchar in SQL.

    Annoyingly I go to paramters but it doesnt show any OR let me create them. I know they are they because they appear in lists and I can create them.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply