Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Data Warehousing / October 2005

Tip: Looking for answers? Try searching our database.

Finding Correct Primary Key

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Erdal Akbulut - 22 Oct 2005 11:16 GMT
Hello,

I could not reach a conclusion on this. Maybe someone helps me to understand
better.

I have a consolidated  text extract from other systems and want to upload
the data to an SQL table.

Below is the fields in extract.

OrderNo
LineNumber
SellingCompany
PurcCtry
FinalizeDt
ItemNo
CustomerID
SalesRep
Quantity
Sales_USD

At first analysis, I thought OrderNo and LineNumber are the PK of the table
and designed the table.

When I receive the data I realized that since the data is coming from
different sources. Some of them has duplicate Orderno LineNumber
combination.

Now my data has two different of type of data one has unique key of Orderno
LineNumber combination. On the other hand second part of data needs OrderNo
LineNumber  ,FinalizeDt,ItemNo      and CustomerID  for a unique key.

Question is : Should I keep these data in two different table, or should I
keep them in a single table by adding more columns on PK ?

What is the affect of defining larger PK even it is not needed for some of
the data?

My table has data has 1.5 million record and increasing 75000 each month.

70 % of data has Unique Orderno Line Number

Data is used by sql server reporting services, I have also some plans to use
analysis server in the future.

Thanks in advance.

erdal,
Myles.Matheson@gmail.com - 23 Oct 2005 11:48 GMT
Hello Erdal,

I usually add a source system key when combining data sets from
different sources. If you add a source system key to Orderno,
LineNumber combination does that give you a unique key?

If the answer is yes then you can have a common table. I normally have
different staging tables and one common table for reporting and star
schema generation.

Hope this helps,

Myles Matheson
Data Warehouse Architect
http://bi-on-sql-server.blogspot.com/
Myles.Matheson@gmail.com - 23 Oct 2005 13:25 GMT
Hello Erdal,

I just re-read my post and forgot to mention that I hard code or
generate the source system key. It helps me trace the source of records
in the systems I build.

Hope this is a bit clearer now,

Myles Matheson
Data Warehouse Architect
http://bi-on-sql-server.blogspot.com/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.