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
    Commented Feb 7, 2013 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
    Commented Feb 7, 2013 at 20:55

1 Answer 1


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 and acknowledge you have read our privacy policy.

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