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

share|improve this question

1 Answer 1

up vote 3 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

 
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.