Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 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?


share|improve this question
up vote 4 down vote accepted

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.

share|improve this answer
Awesome, thanks! – nicolaskruchten Jul 19 '10 at 17:34

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.