﻿<?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 2008 / SQL Server 2008 - General  / Adding a Sequence Number to the records from LKUP No match output / 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>Wed, 22 May 2013 00:21:34 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Adding a Sequence Number to the records from LKUP No match output</title><link>http://www.sqlservercentral.com/Forums/Topic1402376-391-1.aspx</link><description>Because I don't know your structure it's a little difficult, but...I have had to do similar things in the past (although I insisted on design changes) however a concatenation of Source + Source PK could be used?If source is not an integer I would be tempted to maintain a lookup table for sources with a key for source and just append that to the source table(s) PK and do theinsert into the destination..Others may have other ideas (or I may just be shot down in flames for mine ;-) )Edit: sorry I didn't mean append a composite PK would be a better choice..Andy:-)</description><pubDate>Thu, 03 Jan 2013 08:09:13 GMT</pubDate><dc:creator>Andy Hyslop</dc:creator></item><item><title>RE: Adding a Sequence Number to the records from LKUP No match output</title><link>http://www.sqlservercentral.com/Forums/Topic1402376-391-1.aspx</link><description>Well. The destination would be having data from multiple sources.. so i cant go with the PK from source...I found a way to achieve this in script task. But wanted to know if there is a way to do this using ssis itself</description><pubDate>Thu, 03 Jan 2013 07:54:21 GMT</pubDate><dc:creator>MuraliKrishnan1980</dc:creator></item><item><title>RE: Adding a Sequence Number to the records from LKUP No match output</title><link>http://www.sqlservercentral.com/Forums/Topic1402376-391-1.aspx</link><description>Any reason why you can't use the PK from the source table as the PK in the destination?[quote]But for some reason they have gone by this design.[/quote] Crazy! :crazy:</description><pubDate>Thu, 03 Jan 2013 07:43:55 GMT</pubDate><dc:creator>Andy Hyslop</dc:creator></item><item><title>RE: Adding a Sequence Number to the records from LKUP No match output</title><link>http://www.sqlservercentral.com/Forums/Topic1402376-391-1.aspx</link><description>You are absolutely correct Andy and we have already informed the same to our client. But for some reason they have gone by this design.</description><pubDate>Thu, 03 Jan 2013 07:40:17 GMT</pubDate><dc:creator>MuraliKrishnan1980</dc:creator></item><item><title>RE: Adding a Sequence Number to the records from LKUP No match output</title><link>http://www.sqlservercentral.com/Forums/Topic1402376-391-1.aspx</link><description>[quote]The Destination table does not have an identity field. Hence, i would have to increment the PK value myself before inserting[/quote]This sounds like a nightmare waiting to happen for you!Is there any reason why you can't add an auto inc onto your destination table as the current structure will be horrible to maintain..Andy</description><pubDate>Thu, 03 Jan 2013 07:38:58 GMT</pubDate><dc:creator>Andy Hyslop</dc:creator></item><item><title>Adding a Sequence Number to the records from LKUP No match output</title><link>http://www.sqlservercentral.com/Forums/Topic1402376-391-1.aspx</link><description>Hi Friends,I am migrating data from one table to another and I am doing a lookup to find if the record already exists or not. I would insert the records in the destination if it is not present there. The Destination table does not have an identity field. Hence, i would have to increment the PK value myself before inserting. I stored the max of the PK in a variable. I am trying to add a sequence number to the LKUP no match output so that i can create the PK for the new records with the logic max(PK) + Sequence number. However, i am not able to add a sequence number to no match output.Is it possible to do the way i wish or is there any other better solutions.Any help would be appreciated. ThanksMurali</description><pubDate>Thu, 03 Jan 2013 07:35:32 GMT</pubDate><dc:creator>MuraliKrishnan1980</dc:creator></item></channel></rss>