TSQL - one command to copy ALL tables/structure/data into another database

Posted on 2007-07-26
Last Modified: 2008-01-09
Drop everything in database B, copy everything in database A into database B.
Note: Avoiding restoring database A as database B
Question by:coldchillin
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    >Note: Avoiding restoring database A as database B

    there exists no such command to do that in 1 command
    LVL 35

    Accepted Solution


    Do you want the data or just the structure?

    If you want the data, why not just restore the database? In fact, even if you don't want the data, why not restore the database and then truncate all the tables?

    LVL 11

    Assisted Solution

    by:Ved Prakash Agrawal
    you can use SSIS to export all your object into another database.
    LVL 1

    Author Comment

    what is ssis?
    LVL 35

    Expert Comment

    by:David Todd

    SSIS - SQL Server Integration Services.

    This replaces DTS.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    761 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

    8 Experts available now in Live!

    Get 1:1 Help Now