Exporting tables and indexes from one SQL Server 2000 database to another
I hav开发者_如何学编程e a SQL Server 2000 database and some tables in a database.
I want to export them (the structure, definition and indexes) to another database.
I don't want to copy the entire database, only some tables. And it doesn't matter the data that I have in the tables. Is there a form to do it??
I know the export data option but I've tried it and indexes are not created in the tables.
In Enterprise Manager right click on the database name and pick All Tasks->Export Data. Select the source databse, hit next. Pick the destination, hit next. Now pick Copy Objects and data between SQL Server databases and hit next.
- Check Create destination objects (tables, views, stored procedures, constraints, etc.)
- Check Drop Destination Objects First
- Check Include all dependent objects
- Check Copy Data (if you want the data)
- Uncheck Copy All Objects
- Uncheck Use default options
- Press the Select Objects button
- Pick the objects you want to copy and hit ok
- Click the options button
- Select all options except for Generate Scripts in Unicode (unless you want that), hit ok.
- Next, Next, Finish
You should be all set.
精彩评论