October 10, 2008 at 10:26 am
hi,
I am trying to run a foreach loop that takes a rep number as it's input (from a ExecuteSQL task) and for each rep, i want to run a stored procedure that takes in the rep number and returns a recordset.
I am having trouble using the variable. here is the script task snipit that is giving me trouble:
SAgentNumber = Dts.Variables("AgentNumber").Value.ToString()
Dts.Variables("StoredProcedureCall").Value = " exec Proc_InsertShipmentsForNAmericaReportForRepNumber " + Dts.Variables("AgentNumber").Value.ToString()
Dts.Variables("DestinationPath").Value = String.Concat("\\\\usmck-r2w\\Report2Web\\enterprise\\ftpupload\\RouterWatch\\DW North America Agent Number-" + SAgentNumber, String.Concat(Date.Today.Year & "-", Month & "-", Day), ".xls")
So I am trying to call my stored procedure and pass it a variable (the agentNumber) and it just isn't working.
the error i get is:
I have tried looking at the ResultSet and it seems just fine.
If someone can help me with this, it would be greatly appreciated.
Thanks in advance.
Sam
October 10, 2008 at 11:45 am
ok I got it to work but not the way i want it to work. I don't get the error but the files are empty and b/c the variable going in are:
boot.ini,
AutoExec.Bat
Config.Sys
Dell.Sdr
....
So i'll keep plugging...if anybody has any ideas...pls share.
oh by the way, this is what i did to get it to stop erroring on me (if anybody is wondering...)
keeping everything the same but the stored proc line...
Dts.Variables("StoredProcedureCall").Value = " exec Proc_InsertShipmentsForNAmericaReportForRepNumber " + "'SAgentNumber'"
thanks.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply