Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm importing data from one SQLServer2005 instance to another using the Import wizard and getting the importer to drop/create the tables for me. This runs great but on the new server, the tables are created without PK's, FK's or indexes. Is there some option I can set in the importer to do this for me?

If not, is there some simple way to 'import' those definitions after the importer has run and created my tables and populated them?


share|improve this question
up vote 0 down vote accepted

I don't think this is supported out of the box. As a workaround, ygiven a list of tables, you could use PowerShell, SMO, or TSQL to generate the scripts to create the missing objects

share|improve this answer
Thanks! I ended up generating creation-scripts and running them first, and then importing the data with the import wizard. – nicolaskruchten Jul 21 '10 at 16:08
yeah sorry I wasn't thinking straight. The easiest way is to use the built script generation in Management studio. Glad to here you had success. – Jason Horner Jul 21 '10 at 17:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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