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 |
scabral7
Yak Posting Veteran
57 Posts |
Posted - 2010-05-20 : 14:59:31
|
Hi,i have about 50-60 tables in SQL 2000 that i need to move to SQL 2005. The issue is that most of the tables are already in the SQL 2005 database with old data and some of the tables are not there yet.So i need a way to create the tables if they need to be created in SQL 2005 and then truncate the table and move the data from the 2000 table to the 2005 table. I hope that makes sense.is there a good way to do this?thanks |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Kristen
Test
22859 Posts |
Posted - 2010-05-20 : 15:54:11
|
If table does not exist then create itIf table does exist then truncate itHave I got that right? If so why not drop the table if it exists, then create it? SSMS can generate a script to do just that.Are there other tables (not part of this job) which will stay?You can use DTS / SSIS to move the data across - but best to pre-create the tables (so they have all the appropriate defaults etc.) but you may want top create Indexes and Foreign Key constraints after copying the data over (otherwise you may have problems with importing the data in the right order to prevent referential integrity errors) |
|
|
|
|
|