Katheryn
Katheryn

Reputation: 11

Combining multiple sql databases into one database

Here's my problem: I have a website that uses two different nonidentical sql server databases: one that is used to store information about the website users, the other stores information about my online retail store. But my hosting plan would only let me deploy a single database. Hence I want to combine my two databases, to form a single database.

Is there an easy way to combine the two databases into one, instead of creating every single table separately? The two databases do not share any data/columns/tables in common.

Can someone plz let me know how to get through this? I would really appreciate any help.

Thanks!

Upvotes: 1

Views: 4062

Answers (3)

Cade Roux
Cade Roux

Reputation: 89651

You can script the objects and import the data, ensuring that any dependencies are created in the right order.

If you need to maintain any sort of logical separation, you can also use SCHEMAs within the database (starting with SQL Server 2005) to organize them into two distinct areas - this would most likely require an application change, however.

Upvotes: 1

thaBadDawg
thaBadDawg

Reputation: 5220

Use the Import Data tool to move the one database's tables and data from the second database into the first one.

Upvotes: 0

CesarGon
CesarGon

Reputation: 15325

If tables is all you want to move around, I suggest you use the Import and Export Data tool to import all the tables of database A into database B.

If you have views, SPs, etc. I suggest you generate scripts for all of them and run them scripts on the destination database once you have transferred the tables.

Upvotes: 0

Related Questions