How to generate Create Table Script for multiple Tables in a Schema at one time?

Posted on 2014-08-26
Last Modified: 2014-08-26

Is there a way for me to create CREATE TABLE Scripts for all of me existing tables within a single SCHEMA in my Database? Not one at a time, but I need a script that will generate CREATE TABLE SCRIPTS into a single SQL Script. I know that I can right-click and select Script Table as CREATE, but I want to be able to run a script that will list out all 20 tables in my SCHEMA all at once and all in one single deployment script.

I would like to be able to extract the DDL for multiple tables in a single schema so that I can communicate this create table information to my DBA so that they can create these tables in our PROD environment.

Question by:MIKE
    1 Comment
    LVL 75

    Accepted Solution

    you  can choose multiple tables using the wizard

    right click on your database -> Tasks -> generate scripts and choose " specific database objects"  then choose the tables you want to scripted out

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now