Click here to Skip to main content
15,211,424 members
Rate this:
Please Sign up or sign in to vote.
See more:
Dear Friends,

I have Two databases in my SqlServer 2005.

For Example : I have Database(SchoolDB) and another Database(CollegeDB)

Now From these Two DATABASES I need to make One Database.....OK.

My requirement is : In CollegeDB i have two Tables StudentInformation and TeachersInformation. So i have to copy these two tables to SchoolDB Database with all the data in it.


Please can anybody help me, how to do this.


THANKS FOR EVER.
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

Did you try googling it? A quick search for sql server copy table to another database yields tons of results, most of which look promising. Check here[^]

Try reading the FAQs (this one[^] and this one[^]), then do your own Google searches, and then, if you still have the problem, try posting in the forums. We are not here to do your Google searches, or your project/task research. We are here to help you in case you did them already and still have a problem.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Dear friend

SELECT *
INTO Newdb.StudentInformation 
FROM Schooldb.StudentInformation  



same way do it for the other table and other database

in this NEW DB is your new databse

Thank You
Sanju
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

I know the question is over a year old, but no solution is marked as accepted yet.

So, beside Google-ing for the answer or trying the t-sql written by Sanju, I suggest reading this thread first:
Copy tables from one database to another in SQL Server

It provides all the information you've asked for.
Hope I helped
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100