Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

ETL: 22 char unique key in source to 16 char unique key in target? Expand / Collapse
Author
Message
Posted Monday, January 25, 2010 7:26 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, September 12, 2013 7:29 AM
Points: 14, Visits: 41
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 uses
16 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 2000

Thanks
Post #852991
Posted Wednesday, March 17, 2010 10:31 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, August 18, 2014 9:16 PM
Points: 4,576, Visits: 8,347
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:

Create TABLE dbo.AccountIdentifiers (
TwentyTwo char(22) NOT NULL PRIMARY KEY,
Sixteen char(16) NOT NULL DEFAULT (dbo.GenerateUnique16key)
)

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.
Post #885214
Posted Friday, April 16, 2010 1:19 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 8:15 AM
Points: 3,068, Visits: 4,639
Crazy idea... redefine key in target database, make it 22 chars in lenght.

_____________________________________
Pablo (Paul) Berzukov

Author of Understanding Database Administration available at Amazon and other bookstores.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Post #905166
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse