IDENTITY_INSERT ISSUE

Rohit Kulkarni 731 Reputation points
2024-04-08T06:20:22.87+00:00

Hello Team,

I am trying to load the data from azure blob storage to Dedicated sql Pool. For few of the tables the data is getting loaded dynamically and for few of the tables i am getting error :

ErrorCode=UserErrorSqlDWCopyCommandError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=SQL DW Copy Command operation failed with error 'An explicit value for the identity column in table 'TABLE_NAME' can only be specified when a column list is used and IDENTITY_INSERT is ON.',Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=An explicit value for the identity column in table 'TABLE_NAME' can only be specified when a column list is used and IDENTITY_INSERT is ON.,Source=.Net SqlClient Data Provider,SqlErrorNumber=8101,Class=16,ErrorCode=-2146232060,State=1,Errors=[{Class=16,Number=8101,State=1,Message=An explicit value for the identity column in table 'TABLE_NAME' can only be specified when a column list is used and IDENTITY_INSERT is ON.,},],'

My finding :

I have TRIED

SET IDENTITY_INSERT TABLE_NAME ON;

AS WELL AS

SET IDENTITY_INSERT TABLE_NAME OFF;

But still i am getting the same error .Please advise.

Regards

RK

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,374 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2024-04-08T07:49:57.04+00:00

    IDENTITY_INSERT is a session related setting, not a global one. You have to issue it within the same session as you what to load data.


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.