<p>I'm trying to create an SSIS package that takes data from an XML data source and for each row inserts another row with some preset values.  Any ideas?  I'm thinking I could use a DataReader source to generate the preset values by doing the following:</p>

<pre><code>SELECT 'foo' as 'attribute1', 'bar' as 'attribute2'
</code></pre>

<p>The question is, how would I insert one row of this type for every row in the XML data source?</p>

[{'answer_id': 51158, 'author': 'Tadmas', 'author_id': 3750, 'author_profile': 'https://Stackoverflow.com/users/3750', 'pm_score': 2, 'selected': False, 'text': '<p>I\'ve never tried it, but it looks like you might be able to use a <a href="http://msdn.microsoft.com/en-us/library/ms141069(SQL.90).aspx" rel="nofollow noreferrer">Derived Column transformation</a> to do it: set the expression for attribute1 to <code>"foo"</code> and the expression for attribute2 to <code>"bar"</code>.</p>\n\n<p>You\'d then transform the original data source, then only use the derived columns in your destination.  If you still need the original source, you can Multicast it to create a duplicate.</p>\n\n<p>At least I think this will work, based on the documentation.  YMMV.</p>\n'}, {'answer_id': 52159, 'author': 'jwolly2', 'author_id': 5202, 'author_profile': 'https://Stackoverflow.com/users/5202', 'pm_score': 2, 'selected': False, 'text': '<p>I\'m not sure if I understand the question... My assumption is that you have <em>n</em> number of records coming into SSIS from your data source, and you want your output to have <em>n</em> * 2 records.</p>\n\n<p>In order to do this, you can do the following:</p>\n\n<ul>\n<li>multicast to create multiple copies of your input data</li>\n<li>derived column transforms to set the "preset" values on the copies</li>\n<li>sort</li>\n<li>merge</li>\n</ul>\n\n<p>Am I on the right track w/ what you\'re trying to accomplish?</p>\n'}, {'answer_id': 88120, 'author': 'CodeRot', 'author_id': 14134, 'author_profile': 'https://Stackoverflow.com/users/14134', 'pm_score': 0, 'selected': False, 'text': '<p>I would probably switch to using a Script Task and place your logic in there. You may still be able leverage the File Reading and other objects in SSIS to save some code.</p>\n'}]
['https://Stackoverflow.com/questions/51139', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4550/']