Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Two Source tables in to One Target table

Author  Topic 

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2013-01-07 : 13:59:08
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
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2013-01-07 : 14:13:18
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

167 Posts

Posted - 2013-01-07 : 14:19:47
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
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2013-01-07 : 23:35:20
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

52326 Posts

Posted - 2013-01-08 : 00:00:25
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
   

- Advertisement -