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!

link|improve this question
feedback

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

link|improve this answer
Thanks! I ended up generating creation-scripts and running them first, and then importing the data with the import wizard. – njk 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
feedback

Your Answer

 
or
required, but never shown

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