December 5, 2007 at 9:27 am
I have a liitle problem here I am trying to export a few tables from 1 database to another. But when I do that the primary key and indexes get droped. How can I do the export so i could keep all the indexes as is
December 6, 2007 at 12:20 am
Go into Enterprise Manager and using the Import/Export capabilites of "Data Transformation Services" to copy the tables with or without data. Will give you the opportunity to copy keys, indexes, and triggers.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 6, 2007 at 12:12 pm
Specifically, use the "Copy objects and data between SQL Server databases" option of the Import/Export Wizard or the Copy SQL Server Objects task in DTS Designer to retain indexes and constraints.
Greg
Greg
December 6, 2007 at 10:39 pm
it should be noted the sql server DTS will sometimes change the metadata of a table. In other words if you have a numeric field Like (numeric (11,2)) when the DTS package creates the table it might change it to the Money data type. You can change this in transformations.
Or you can script out the table and it's indexes and so on. The create the table on the other database then export and import the data. This will ensure everything is the exact same with out messing with the transformations.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply