SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Two Source tables in to One Target table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sql_server_dba
Posting Yak Master

160 Posts

Posted - 01/07/2013 :  13:59:08  Show Profile  Reply with Quote
We have two tables.... A with 70 fields and B 30 fields with the same primary KEY and same number of records(50 million records). Is it better to store them in one table or better to separate them in target?

Thanks in Advance!!!

sodeep
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 01/07/2013 :  14:13:18  Show Profile  Reply with Quote
Do they have same fields? What exactly are you trying to achieve? We need to understand clearly before we answer.
Go to Top of Page

sql_server_dba
Posting Yak Master

160 Posts

Posted - 01/07/2013 :  14:19:47  Show Profile  Reply with Quote
NO, they do not have same fields. Only the PK is same for the two tables. My question is, is it better to have a table with 100 fields or is it better to have two tables with 70 and 30 fields. Once this is determined, i need to use this table with other tables for reporting purposes.
Go to Top of Page

sodeep
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 01/07/2013 :  23:35:20  Show Profile  Reply with Quote
I would have them in same table with better indexing. Lookup for Table Partitioning. You can also think about normalizing table if it is used for Transactional system.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/08/2013 :  00:00:25  Show Profile  Reply with Quote
question is what are you storing in those 100 columns? will they have data atleast for good majority of rows? are they optional attributes? if yes you could consider other options too like going for EAV approach or using sparse columns etc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000