I'm working on a few ASP.NET MVC projects which all require database functionality. Unfortunately, my hosting provider only gives me two SQL Server databases to work with, so I want to put the tables of multiple projects into a single database.
However, some of my tables are similarly named, so I might run into some issues. Thus, I'm trying to find a way to change the names of all the tables so that they reflect what application they belong to.
Currently, I have the following tables in Project A:
Table1
Table2
In Project B, I have these tables:
Table1
Table2
I would like to combine the tables into a single database:
ATable1
ATable2
BTable1
BTable2
My Questions
- How can I automatically add a prefix to the names of all of the tables inside of a SQL Server database?
- Is it possible to have LINQ to SQL automatically map
Table1
from my code intoATable1
orBTable1
(depending on what application it is)?