I am new to SMO, Till now I have only worked with Selct,Insert/update Queries.. Now I want to Implement some backup and restore feature for my application. I looked at some documents of SMO and found it is possible using SMO.
First of all I will explain my situation.
My application wants to store data belongs to different companies(which is maintained with in application) in to single database server, Sql server 2008.
I am planning to use Partition Scheme function and create filegroup for each company. Advantage here is, taking backup of each company will be easy.
I am generating primary key for each table without taking into consideration of companies. In other words Particular table's ID 1,2 belongs to Company A, 3 Belongs to Company B and 5 belongs to Company A... But these data will be split in to Different filegroups using Company ID.(horizontal partitioning)
Ok... Now the Problem..
My backup for a particular company was taken successfully. Now I want Restore function. When I am trying to restore this backup to somewhere else. Target database may or may not contain Companies installed. When Restoring Will there be any Primary key Violation?
I know one solution is to generate primary key by taking into consideration Company Id. But this will cause a complete rewriting of code, as it contains lot of edit/delete queries.
I want to know, whether the
View Complete Post