Transfer SQL Server Objects task, PK problem

  • i have a job that copies 20 tables or so once a month to an archive database. some of the tables have 10 indexes and they aren't needed in the archive copies. all I need is the PK and clustered index at most because there is a BI process that reads those tables right after the copy process.

    My problem is that i have to enable copy indexes to get the primary key to copy. It's not that big a deal, but then i have to go back and delete the indexes to free up space. is there anyway to copy only the PK without copying the rest of the indexes?

    the process is fairly simple. first it copies the table then renames it along with the PK

  • Maybe you could do the copy and then just add the PK constraint back in with some T-SQL at the end ...?


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply