Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

Thanks!

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.