vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have two SQL servers I am dealing with. I have some tables in one database on one SQL server that I want to transfer into a database on the other SQL server. I want to xerox copy the tables including all primary keys, identities, defaults etc. I used the export/import feature in Enterprise Manger, but when I do it, and view the tables that got imported, all of my defaults are gone and all the primary keys are gone. What is the best way to just copy a few tables from one database to another. I do NOT want to copy the entire database from one SQL server to the other, only a few tables. I just want to make sure that when they are imported they are exactly the same as where they came from. THANKS |
| ||||
| "Erich" <ehaemmerle@hotmail.com> wrote in message news:1034rskek9att29@corp.supernews.com... > I have two SQL servers I am dealing with. I have some tables in one database > on one SQL server that I want to transfer into a database on the other SQL > server. I want to xerox copy the tables including all primary keys, > identities, defaults etc. I used the export/import feature in Enterprise > Manger, but when I do it, and view the tables that got imported, all of my > defaults are gone and all the primary keys are gone. What is the best way to > just copy a few tables from one database to another. I do NOT want to copy > the entire database from one SQL server to the other, only a few tables. I > just want to make sure that when they are imported they are exactly the same > as where they came from. THANKS > > One way would be to script the objects in Enterprise Manager, making sure to check the box "Generate scripts for all dependent objects", then run the scripts in the target database. That will recreate the tables but not the data, so you could use DTS or BCP to copy that over. Simon |