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

OGINTZ Marina 85 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.
13,126 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,932 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,311 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.