Note that there are some explanatory texts on larger screens.

plurals
  1. POInsert Data using OLE DB Destination
    text
    copied!<p>Hi I'm just new with SQL Server and SSIS and I badly need your help with this.</p> <p>I have inserted 10 rows of data from Table A to another new table called Test_Table_Destination which I also created inside a TEST server. In the OLE DB Source I put the select statement..</p> <pre><code> SELECT top 10 ResourceID, ShortName, SupervisorID from BI_Test_DB.dbo.Resource </code></pre> <p>In the OLE DB destination editor, I choose Table or View - Fast Load.</p> <p>On my FIRST ATTEMPT - After Running the package, it turned green and became successful. The 10 rows were added to the Newly created Test_Table_Destination</p> <p>Now my problem starts here:</p> <p>On my SECOND ATTEMPT - When I try to change the script in the OLE DB Source to..</p> <pre><code>SELECT top 20 ResourceID, ShortName, SupervisorID from BI_Test_DB.dbo.Resource </code></pre> <p>Of course my goal is to load the top 20 rows without repeating or duplicating the first 10 rows on my first attempt of running the package so I changed the script into this.</p> <pre><code>INSERT INTO dbo.Test_Table_Destination SELECT top 20 ResourceID, ShortName, SupervisorID from BI_Test_DB.dbo.Resource WHERE ResourceID NOT IN (SELECT ID FROM dbo.Test_Table_Destination) </code></pre> <p>But it does not work.. So I tried to put the script in the SQL command editor inside the OLE DB Destination editor, under sql command text.. I put this script</p> <pre><code>INSERT INTO dbo.Test_Table_Destination SELECT top 20 ResourceID, ShortName, SupervisorID from BI_Test_DB.dbo.Resource WHERE ResourceID NOT IN (SELECT ID FROM dbo.Test_Table_Destination) </code></pre> <p>And I keep getting errors. What should I do with this? How can I insert data to a new or old table without duplicating or repeating the same previously loaded data?</p> <p>Ideally it should now repeat the first 10 rows on my second attempt of running the package. I want to see the top 20 rows only.</p> <p>Thank you in advance!</p> <p>Beau</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