how to copy several tables from one server to another including PK, Indexes etc

Nishan Ratna 150 Reputation points
2023-04-04T23:11:19.3+00:00

Hi All, Is there a way to copy several tables from one server to another server including primary key, indexes etc. I can use transfer sql server objects task in SSIS. However I am not able to automate the process. I want to automate it. Can someone help me please? Thanks

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,675 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. ZoeHui-MSFT 41,446 Reputation points
    2023-04-05T01:35:27.1833333+00:00

    Hi @Nishan Ratna ,


    You may use Transfer SQL Server Objects Task in SSIS. The Transfer SQL Server Objects task transfers one or more types of objects in a SQL Server database between instances of SQL Server. For example, the task can copy tables and stored procedures.


    When copying tables, you can indicate the types of table-related items to include in the copy process. The following types of items can be copied together with the related table: User's image


    A tutorial here, you may take a reference to.


    Regards,


    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


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.