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 |
|
sunnykj
Starting Member
29 Posts |
Posted - 2004-07-05 : 05:15:30
|
| When I inported the DB,the table of this DataBase's PK was Lost!Why? And How Can I inport a table with its PK? Thanks! |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-05 : 07:02:02
|
| How did you import the DB?I would SCRIPT the table (Enterprise Manager : Generate SQL), run the script and then import the dataKristen |
 |
|
|
sunnykj
Starting Member
29 Posts |
Posted - 2004-07-05 : 20:49:22
|
| Kristen,ThanksThe DB was inported from the other DB server by the DTS inport/export Wizard ,Could I inported the DB and DB's table with its PKs by this way? If it can achieve it, how? Sunnykj |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-07-05 : 23:05:40
|
| Instead of selecting Copy tables and views, select Copy objects and data. Then hit next. Select the option to create and drop. You probably don't want to include dependent objects. Uncheck Copy all objects, press the Select Objects button and select your table. Uncheck Use Default options, press the Options button, and uncheck the top selection to copy database users and roles. Make sure you have Copy PRIMARY and FOREIGN keys checked.When you import it this way, it will include the primary keys. The other option will not.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
sunnykj
Starting Member
29 Posts |
Posted - 2004-07-06 : 02:38:31
|
| I follow your steps inport it again,The problem was resolved, Thank you very much! |
 |
|
|
|
|
|
|
|