Copying all tables from one Azure Managed Instance database to another

Vijay Kumar 2,036 Reputation points
2025-04-28T00:09:58.4133333+00:00

What is the best method to copy all tables from DatabaseA to DatabaseB in an Azure Managed Instance, including all object-level permissions, triggers, views, and indexes?

The Export/Import and SELECT * INTO methods are known not to retain object-level permissions, triggers, views, and indexes. Using the Generate Script option in SQL Server Management Studio (SSMS) raises concerns due to the size of the source database, which is approximately 1.5 TB. Are there alternative approaches for this scenario?

SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
177 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.