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
 Transact-SQL (2008)
 data migration

Author  Topic 

Gordon.Davis
Starting Member

4 Posts

Posted - 2011-09-11 : 02:42:31
hello folks,
I have database which contains all the company's data with each company having unique id.Now i have created a five databases and ddistributed the data by using companyid.Now,the scenario is when we move to production i need to do quick validation of the count of data.please help me with this.
NOTE:when moving the data i need to specify that NOT all the
Tables are moved only tables with respective the companies are moved to their respective databases.
PLEASE HELP ME WITH THIS

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-11 : 05:47:45
You can use a UNION ALL query.

I don't see why you'd design a system like this though. All companies should be in one database.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-11 : 11:55:25
why cant you hold the company itself as a master table in your system and then refer it in all the tables using foreign key company id. thus you will be able to integrate it to the same system. in future if you want to add one more company also you can do it rather than adding up a new db. so its scalable also. if amount of data is large you can think about options like table partitioning and also add proper indexes/keys to make sure your queries are optimised.

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

Go to Top of Page
   

- Advertisement -