Creating multiple instances of a generic database

Posted by sagekilla on Stack Overflow See other posts from Stack Overflow or by sagekilla
Published on 2010-04-08T17:33:36Z Indexed on 2010/04/08 17:43 UTC
Read the original article Hit count: 177

Filed under:
|

Hi all, currently I'm trying to have a setup where a generic database is distributed to students. They would develop an application using this database (Say a shopping cart application), submit their project onto our server, and then it would be graded automatically.

These databases are being run in Microsoft SQL Server 2005.

We're using user instances to instantiate each database, and multiple requests could be serviced at once. But, the problem is when more than one student submitted a project to be graded, the first database to be instantiated would be the only one and would overwrite all other copies that were currently open.

So if stu1 modified his database and stu2 and stu3 had their projects being graded concurrently, at the end of the grading stu1, stu2, and stu3 would have identical DB's at the end.

Is there any way I can have multiple independent copies of a generic database, each of which I can load concurrently and modify without having any changes made to any one affecting the others?

I did a little reading, and thought it might be possible to do something along the lines of:

  1. Student submits project
  2. Attach the database with unique db name (specified by student)
  3. Do all necessary operations
  4. Detach the database

I'm unsure if this would fix our problem or be possible, so any help would be much appreciated!

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql-server-2005