最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

azure sql database - Cannot insert the value NULL into column -ADF Pipeline failure - Stack Overflow

programmeradmin1浏览0评论

While running Copy Activity in a pipeline of Azure Data Factory, i'm getting below pipeline error.

*The RowID is to count rows in the Database which should not take any NULL value in the column. The source XML file does not have any RowID Column.

Copy Activity is connected to Two Source and Sink datasets, and both of them are connected to Stage Database and Master Database. And they both have RowID Schema.


Failure happened on 'Sink' side. ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed. Please search error to get more details.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=Cannot insert the value NULL into column 'RowID', table 'MyDB.dbo.MyData'; column does not allow nulls. INSERT fails. The statement has been terminated.,Source=.Net SqlClient Data Provider,SqlErrorNumber=515,Class=16,ErrorCode=-2146232060,State=2,Errors=[{Class=16,Number=515,State=2,Message=Cannot insert the value NULL into column 'RowID', table 'MyDB.dbo.MyData'; column does not allow nulls. INSERT fails.,},{Class=0,Number=3621,State=0,Message=The statement has been terminated.,},],'


Cannot figure out in which pipeline it is trying to INSERT a NULL value to Stage and Master Database.

While running Copy Activity in a pipeline of Azure Data Factory, i'm getting below pipeline error.

*The RowID is to count rows in the Database which should not take any NULL value in the column. The source XML file does not have any RowID Column.

Copy Activity is connected to Two Source and Sink datasets, and both of them are connected to Stage Database and Master Database. And they both have RowID Schema.


Failure happened on 'Sink' side. ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed. Please search error to get more details.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=Cannot insert the value NULL into column 'RowID', table 'MyDB.dbo.MyData'; column does not allow nulls. INSERT fails. The statement has been terminated.,Source=.Net SqlClient Data Provider,SqlErrorNumber=515,Class=16,ErrorCode=-2146232060,State=2,Errors=[{Class=16,Number=515,State=2,Message=Cannot insert the value NULL into column 'RowID', table 'MyDB.dbo.MyData'; column does not allow nulls. INSERT fails.,},{Class=0,Number=3621,State=0,Message=The statement has been terminated.,},],'


Cannot figure out in which pipeline it is trying to INSERT a NULL value to Stage and Master Database.

Share Improve this question asked Nov 19, 2024 at 8:44 TankTopTankTop 11 silver badge1 bronze badge 3
  • can you add smaple input and expected output? – Pratik Lad Commented Nov 19, 2024 at 8:50
  • They were asked for that in the Staging Ground and someone approved it anyway... /sigh – Thom A Commented Nov 19, 2024 at 9:14
  • can you add image of your pipeline for better understanding? – Pratik Lad Commented Nov 19, 2024 at 9:55
Add a comment  | 

1 Answer 1

Reset to default 1

Cannot insert the value NULL into column 'RowID', table 'MyDB.dbo.MyData'; column does not allow nulls. INSERT fails. The statement has been terminated

As per the error you're encountering it shows that in your sink database (where copy activity storing the data) has a RowID column defined as NOT NULL, but the data being inserted into it does not provide a value for RowID. Since RowID is mandatory as per your destination schema, the insert operation fails.

As your destination database can't take null values and source does not have RowId column, you need to generate the column. for this you can use Data Flow activity to create RowId column and copy the data to destination database.

In data flow using Surrogate key transformation You can create RowId column as below:

Data Preview for this is as below:

发布评论

评论列表(0)

  1. 暂无评论