﻿<?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 7,2000 / Strategies  / ETL: 22 char unique key in source to 16 char unique key in target? / 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>Fri, 24 May 2013 18:17:39 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: ETL: 22 char unique key in source to 16 char unique key in target?</title><link>http://www.sqlservercentral.com/Forums/Topic852991-49-1.aspx</link><description>Crazy idea... redefine key in target database, make it 22 chars in lenght.</description><pubDate>Fri, 16 Apr 2010 13:19:03 GMT</pubDate><dc:creator>PaulB-TheOneAndOnly</dc:creator></item><item><title>RE: ETL: 22 char unique key in source to 16 char unique key in target?</title><link>http://www.sqlservercentral.com/Forums/Topic852991-49-1.aspx</link><description>I suppose you have some auto-generator for unique 16-char codes.Let's say it's encapsulated in function dbo.GenerateUnique16key.Then you should have something like this:[code]Create TABLE dbo.AccountIdentifiers (     TwentyTwo char(22) NOT NULL PRIMARY KEY,     Sixteen char(16) NOT NULL DEFAULT (dbo.GenerateUnique16key))[/code]When new records arrive insert 22-char codes into this table.Table will generate 16-chars unique codes and assign them to imported 22 char codes.Then mapping (converting) will be easy once and forever.</description><pubDate>Wed, 17 Mar 2010 22:31:34 GMT</pubDate><dc:creator>Sergiy</dc:creator></item><item><title>ETL: 22 char unique key in source to 16 char unique key in target?</title><link>http://www.sqlservercentral.com/Forums/Topic852991-49-1.aspx</link><description>Hi,We are doing an ETL from one database into another database.Our source data table has a primary key of 22 alpha-numeric. We need to load this into our target table (already with data) which uses16 alpha-numeric characters. We have managed to logically shave off 4 characters down to 18 chars, but if we go down to 16 characters for our target table we lose uniqueness.We do have other fields in the target table that we can make use of to hold data if this helps.The situation is that we are pulling Accounts receivable from one app to an existing AR application. We are doing an intial load and then we will perform a nightly load process afterwards as the source app will continue to be used. The target app is where we perfrom our backoff financials, BI, etc. In the future the target app will be made decomissioned.Just read a surogate ID article that might help but we need to be able to tie back our target table data to the source table in the source application as it is still being used.Are there any strategies for going from 22 len field to 16 and not lose uniqueness but still be able to resolve between the 2 tables/applications for example (auditing purposes).using SQL Server 2000Thanks</description><pubDate>Mon, 25 Jan 2010 07:26:39 GMT</pubDate><dc:creator>haggisns</dc:creator></item></channel></rss>