Sql-server – Exporting table/view definitions for sql server 2005

exportmigrationsql server

I'm trying to migrate some database tables from one SQLServer2005 instance to another, by first creating the tables/views on the new server, then re-running some data import scripts.

What's an easy way to quickly get the CREATE TABLE and CREATE VIEW statements for some tables/views on the old server? Or is there another, easier way to do this?

Thanks!

Best Answer

Using the SQL Management Studio you can use the Generate Script functionality to generate an SQL script to create some or all of the objects in the database, suitable for execution on another server.