OLE DB Command and optional parameters for a stored procedure
I'm building an SSIS Package with BIDS 2008R2. The database that I wish to execute the SP on is SQL Server 2005 with SP4 4. I have a procedure similar to this: CREATE PROCEDURE test_insert ( @parm1 int ,@parm2 varchar(50) = NULL ,@parm3 varchar(50) = NULL ,@parm4 datetime = NULL ,@parm5 datetime ,@parm6 int ) AS ... In the Component Properties of the OLE DB Command, I specified the SqlCommand as: EXEC dbo.test_insert @parm1 = ?, @parm5 = ?, @parm6 = ? Hit Refresh, and got no errors. However, when I go to Column Mappings, in the destination columns, I see 3 columns listed. But they are not the 3 specified (@parm1, @parm5 and @parm6) Instead, they are the first 3 parameters to the stored procedure @parm1, @parm2, and @parm3. All the parameters that were skipped do have a default of NULL assigned. I'm not sure why I'm not getting the correct list of parameters when mapping. Any help greatly appreciated
September 18th, 2012 5:28pm

Instead, they are the first 3 parameters to the stored procedure @parm1, @parm2, and @parm3. ... I'm not sure why I'm not getting the correct list of parameters when mapping. Hello, The parameter list is correct. Not the SP parameter are listed, it's the list of the OleDB (unnamed) parameter you defined with the ? placeholders. For OleDB they are unnamed and you have to take care about the order of the parameter, means the first ? is param1, the second ? is param2 and so on.Olaf Helper Blog Xing
Free Windows Admin Tool Kit Click here and download it now
September 18th, 2012 11:38pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics