How do I copy all columns properties with copy activity in data factory

OGINTZ Marina 105 Reputation points
2024-05-26T07:29:16.98+00:00

Hi,

I'm copying data from one DB to another DB with copy activity and auto create table.

I noticed that when the table is creating on the target side it is creating with the column size and type but all the other properties are lost, for example Null/Not Null always become Null. How can I copy all column properties ?

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,017 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,872 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,456 Reputation points Microsoft Employee
    2024-05-27T05:32:51.4233333+00:00

    Hi OGINTZ Marina,

    Thank you for posting query in Microsoft Q&A Platform.

    yes, we are right, Auto create table option, automatically creates table but few internal properties will be default as you observed.

    You can consider either of below two approaches to handle it.

    1. After you copy activity completes, try to alter table columns, to replicate exactly same as source table columns.
    2. Before copy activity, try to create table by your own using script activity and then copy activity to copy data into that table.

    Please note, you can run script on source table first to get the DDL of table and then run same script in sink before copy activity.

    Hope this helps. Please let me know how it goes or if any further queries. Thank you.

    1 person found this answer helpful.

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.