Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Mng
Yak Posting Veteran
59 Posts |
Posted - 2010-04-02 : 08:11:42
|
| Hi, i am trying to move a "Student" table from database "DB1" to database "DB2" using import and export wizard. It wents fine and the data is transfered. But i realise, that its not getting constraints like primary key, identity etc.How can i acheive this. I need to move some tables from one DB to another DB with all data along with constriants and keys. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-04-02 : 08:21:47
|
| 1 Script Tables and run them in DB22 Write queriesInsert into DB2..table (column_list)select column_list from DB1..table...MadhivananFailing to plan is Planning to fail |
 |
|
|
Mng
Yak Posting Veteran
59 Posts |
Posted - 2010-04-02 : 08:28:09
|
Hi Madhivan,Is this a way to write a query..i tried this but getting error saying object not found.Insert into dbo.DB2.Student Select * from StudentError:Invalid object name 'dbo.DB2.Student'.If i do like this, i can get constratins, indexes and primiarykeys of a table from Db1 to Db2 ??quote: Originally posted by madhivanan 1 Script Tables and run them in DB22 Write queriesInsert into DB2..table (column_list)select column_list from DB1..table...MadhivananFailing to plan is Planning to fail
|
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-04-02 : 10:07:01
|
| It should beInsert into DB2.dbo.Student Select * from StudentMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|