-2

what can be a easy way to create new db when we create new customer record?

Scenario:

  1. I have list of customers [may be upto 500 customers] in master database
  2. Whenever I add new customer in my application, I would like to create new separate database to each client [just to separate respective clients' data entirely from each other]
  3. Application will connect to master database and respective client db as per login credential.

    • No of customers may be upto 500,
    • I am planning to add only 50 dbs per server instance, after that again will be adding to next server instance

Options I have selected:

  1. Use Code first approach of ef6.0 to create and seed primary data of each client when new client is added
  2. Use Custom "Create database script" and import seed data from custom script.sql file
KoolKabin
  • 17,157
  • 35
  • 107
  • 145

1 Answers1

1

Copy SQL Server database in code would be a reasonable option for backing up and restoring an existing 'vanilla' (i.e. with no customer data in it) database.

Of course you only need to backup once - you just restore for each new customer.

CodeNotFound
  • 22,153
  • 10
  • 68
  • 69
mjwills
  • 23,389
  • 6
  • 40
  • 63