本文发表在 rolia.net 枫下论坛1.Select the table you want to move, right click then go to 'All Tasks' then 'Generate SQL Scripts...'. This will bring up a command box to select any/all objects in SQL to script out into a .sql file. Go to the 'Options' tab that has several check boxes. If you want the defaults for that table, tick the last box under the 'Table Scripting Options' heading.
After you save the file, open it in Query Analyser and connect to the DB where you want the new table. Run the script and that should generate the table minus the data. Then use DTS to transfer data between SQL Servers.
2.using the Import/Export wizard and selecting the option: 'Copy table(s) and view(s) from the source database'.
On the screen that you select the table(s) you want to transfer click on the correspoding transform column. At that point you get a window named 'Column Mappings and Transformation'. Click on 'Edit SQL'. You will see the SQL to create the table. There is where you would have to write the SQL to add the default constraint. I think DTS will not create the default constraints by default. You have to explicitly define it yourself.更多精彩文章及讨论,请光临枫下论坛 rolia.net
After you save the file, open it in Query Analyser and connect to the DB where you want the new table. Run the script and that should generate the table minus the data. Then use DTS to transfer data between SQL Servers.
2.using the Import/Export wizard and selecting the option: 'Copy table(s) and view(s) from the source database'.
On the screen that you select the table(s) you want to transfer click on the correspoding transform column. At that point you get a window named 'Column Mappings and Transformation'. Click on 'Edit SQL'. You will see the SQL to create the table. There is where you would have to write the SQL to add the default constraint. I think DTS will not create the default constraints by default. You have to explicitly define it yourself.更多精彩文章及讨论,请光临枫下论坛 rolia.net