load a table without unique indentifier

View previous topic View next topic Go down

load a table without unique indentifier

Post  kepb on Mon May 30, 2011 6:30 pm

Hi i got a doubt.

i try to load a table to a staging area.

so my problem is that that table doesnt have a primary key if i try to create one put together fields to get a unique identifier i cant either. so i need an advice to know how load that table in order to make incrementals load of it .

thanks
avatar
kepb

Posts : 8
Join date : 2011-05-05
Age : 32
Location : PERU

View user profile

Back to top Go down

Re: load a table without unique indentifier

Post  ngalemmo on Tue May 31, 2011 9:50 am

Why do you need a primary key?
avatar
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

View user profile http://aginity.com

Back to top Go down

LOAD A TABLE WITHOUT UNIQUE INDENTIFIER

Post  kepb on Tue May 31, 2011 10:00 am

Hi thanks for answer.

i need a primary key in order to make a incremental load. i work in sql server. so to do incremental load i use the lookup control and it need at least one column to compare the row and determine if the row if already load.

to find out if the row exist i can compare all columns. but is complicated when i try to find the updates load.

or maybe can make it in other way ....

thanks
avatar
kepb

Posts : 8
Join date : 2011-05-05
Age : 32
Location : PERU

View user profile

Back to top Go down

Re: load a table without unique indentifier

Post  ngalemmo on Tue May 31, 2011 11:51 am

You answered your own question.

If you have nothing from which you can identify two things to compare, you can't very well compare them. This is true in databases and life in general...

You may need to rethink your source or how you load the DW.

avatar
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

View user profile http://aginity.com

Back to top Go down

LOAD A TABLE WITHOUT UNIQUE INDENTIFIER

Post  kepb on Tue May 31, 2011 11:58 am

Hi yes you right i guess i complicated myseft. now i rethink the problem and figure it out that joining that table whith other (s) i find some kind of relation
thanks your tour time I really appreciate your support
avatar
kepb

Posts : 8
Join date : 2011-05-05
Age : 32
Location : PERU

View user profile

Back to top Go down

Re: load a table without unique indentifier

Post  BoxesAndLines on Tue May 31, 2011 6:29 pm

Create a check sum based on all of the columns.
avatar
BoxesAndLines

Posts : 1212
Join date : 2009-02-03
Location : USA

View user profile

Back to top Go down

[quote="BoxesAndLines"]Create a check sum based on all of the columns.[/quote]

Post  kepb on Wed Jun 01, 2011 10:40 am

Hi mm but maybe im wrong in that case any change in one row its gonna be identified as a new row?
avatar
kepb

Posts : 8
Join date : 2011-05-05
Age : 32
Location : PERU

View user profile

Back to top Go down

Re: load a table without unique indentifier

Post  VHF on Wed Jun 01, 2011 11:41 am

You should try to identify a compound primary key--some combination of fields that uniquely identifies a row. Once you can uniquely identify a row, then you can do inserts or updates as needed.

If your incoming data really doesn't have a key--that is, you might get multiple records with the exact same values in every field, and these records represent different events/occurrences--then it is impossible to do updates; you would need to treat each new occurrence of a record as an insert.


VHF

Posts : 236
Join date : 2009-04-28
Location : Wisconsin, US

View user profile

Back to top Go down

by VHF on Wed Jun 01, 2011 10:41 am

Post  kepb on Wed Jun 01, 2011 6:10 pm

Hi yes i really try to fing a compound primary key but is dificult and i allready thought about threat each occurrence like a new record but i guess is not secure because the table i try to load is about Historical payments. i allready try to valide by dates like.

i run de load today but before delete all records of today. im thinking about it.........
avatar
kepb

Posts : 8
Join date : 2011-05-05
Age : 32
Location : PERU

View user profile

Back to top Go down

Re: load a table without unique indentifier

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum