Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problem you are experiencing is a result of one of two things. Either you have not set up the <strong>Parameter Mapping</strong> in your Execute SQL Task, or not set the <strong>BypassPrepare</strong> setting in the settings of the same task, which is most likely the case.</p> <p>I managed to recreate your error, as well as bypass it. The steps I followed are as follows:</p> <ol> <li>Recreated your DB with just those two tables specified in your query. Tested it out with hard-coded values to be certain that it works. </li> <li>Added two variables to my package - <strong>BaseID</strong> &amp; <strong>DirectoryID</strong> and gave them some default values.</li> <li>Created an SQL Execute Task and added your query to the <strong>SQLStatement</strong>.</li> <li>Went to <strong>Parameter Mapping</strong> and mapped the two variables specifying Parameter names of <strong>0</strong> &amp; <strong>1</strong>. At this point my <strong>BypassPrepare</strong> option was set to <strong>False</strong>, running the task resulted in the exact error you are receiving.</li> <li>Set the <strong>BypassPrepare</strong> option to <strong>True</strong>. Executing the task resulted in success and a row being added to the DB without any problem.</li> </ol> <p>For information about this specific property (used in a different context, but has the same general functionality) see: <a href="http://technet.microsoft.com/en-us/library/microsoft.sqlserver.dts.tasks.executesqltask.executesqltask.bypassprepare.aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/microsoft.sqlserver.dts.tasks.executesqltask.executesqltask.bypassprepare.aspx</a></p> <hr> <p><strong>UPDATE</strong></p> <p>The solution given is for an SQL Execute Task, not for an OLE DB Command. Changing the location of the '?' value parameters in the SQL query to the front as stated by the OP works around this issue.</p> <p>Another option is to fall back onto calling a Stored Procedure.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload