Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3157
  • Last Modified:

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

Drop everything in database B, copy everything in database A into database B.
Note: Avoiding restoring database A as database B
0
coldchillin
Asked:
coldchillin
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>Note: Avoiding restoring database A as database B
why?

there exists no such command to do that in 1 command
0
 
David ToddSenior DBACommented:
Hi,

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?

Regards
  David
0
 
Ved Prakash AgrawalDatabase Consultant/Performance ArchitectCommented:
you can use SSIS to export all your object into another database.
0
 
coldchillinAuthor Commented:
what is ssis?
0
 
David ToddSenior DBACommented:
Hi,

SSIS - SQL Server Integration Services.

This replaces DTS.

Regards
  David
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now