1

If I have two tables that have identical constraints, datatypes and primary keys is there a way to 'import' the index from one table to another if they're on the same server, but in separate databases?

  • 3
    99% sure you need to script indexes out then run the scripts on the new table. – JNK Feb 7 '13 at 19:07
  • 1
    @JNK: add another 1%. One might configure replication between the two databases and set the first one to send DDL changes to the second, but it's not really a nice solution :-). You could use a db compare tool to have the script generated for you. – Marian Feb 7 '13 at 20:55
3

The only option will be to script out the index and create it on the new table in the other database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.