﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 Integration Services  / Inserting new rows only from Excel to OLE DB Source / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 20:42:20 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Inserting new rows only from Excel to OLE DB Source</title><link>http://www.sqlservercentral.com/Forums/Topic1427578-148-1.aspx</link><description>OK, here's one way.1) Create an integer variable in your SSIS package - say MaxId.2) An an ExecuteSQL task which connects to your target db (the one you are importing to) and does something like this:select MaxId = max(Id) from dbo.Customers3) Configure the ExecuteSQL task to return the result into the MaxId variable.4) Create a data flow task and add an OLE DB source. Define the connection as your source db.5) Set the data access mode to SQL Command.6) Write the SQL command text, using a parameterised query to select [column list] where Id &amp;gt; MaxId.7) Connect the OLEDB source to a suitable configured OLEDB destination.</description><pubDate>Wed, 06 Mar 2013 13:01:51 GMT</pubDate><dc:creator>Phil Parkin</dc:creator></item><item><title>RE: Inserting new rows only from Excel to OLE DB Source</title><link>http://www.sqlservercentral.com/Forums/Topic1427578-148-1.aspx</link><description>[quote][b]Phil Parkin (3/6/2013)[/b][hr]Cool - is it an ascending number?The reason I ask: one way to do this would be to query your existing data, get max(id) and then get the new data by selecting from it where id &amp;gt; maxid.By the way, what happens if changes to existing data occur - don't you want to update that too?[/quote]Yes, ascending number. It is auto generated by the system, and customers are never deleted. In this case I'm only interested in appending the data.</description><pubDate>Wed, 06 Mar 2013 12:37:22 GMT</pubDate><dc:creator>DVSQL</dc:creator></item><item><title>RE: Inserting new rows only from Excel to OLE DB Source</title><link>http://www.sqlservercentral.com/Forums/Topic1427578-148-1.aspx</link><description>Cool - is it an ascending number?The reason I ask: one way to do this would be to query your existing data, get max(id) and then get the new data by selecting from it where id &amp;gt; maxid.By the way, what happens if changes to existing data occur - don't you want to update that too?</description><pubDate>Wed, 06 Mar 2013 12:31:29 GMT</pubDate><dc:creator>Phil Parkin</dc:creator></item><item><title>RE: Inserting new rows only from Excel to OLE DB Source</title><link>http://www.sqlservercentral.com/Forums/Topic1427578-148-1.aspx</link><description>There is a PK in place, which is a Customer ID.</description><pubDate>Wed, 06 Mar 2013 12:24:18 GMT</pubDate><dc:creator>DVSQL</dc:creator></item><item><title>RE: Inserting new rows only from Excel to OLE DB Source</title><link>http://www.sqlservercentral.com/Forums/Topic1427578-148-1.aspx</link><description>How will you identify whether a customer already exists - what is the PK?</description><pubDate>Wed, 06 Mar 2013 12:22:43 GMT</pubDate><dc:creator>Phil Parkin</dc:creator></item><item><title>Inserting new rows only from Excel to OLE DB Source</title><link>http://www.sqlservercentral.com/Forums/Topic1427578-148-1.aspx</link><description>I would like to add something to SSIS package, which will allow it to only insert rows that don't already exist in the database table. Customer table export from a cloud based software exports the entire customer list, so I don't have an option to export just new customers. How can this be accomplished?</description><pubDate>Wed, 06 Mar 2013 12:18:43 GMT</pubDate><dc:creator>DVSQL</dc:creator></item></channel></rss>