Forum Discussion

PraveenVeli's avatar
PraveenVeli
Advocate I
5 months ago
Solved

Identity Insert On Warehouse table

Hi,

With data warehouse, I heard IDENTITY_INSERT is now supported on identity columns. When I try to use IDENTITY_INSERT, I still get the "Incorrect syntax near 'IDENTITY_INSERT'." error.

 

CREATE TABLE dbo.Test
(
ID bigint IDENTITY NOT NULL,
Name varchar(50) NOT NULL
)

SET IDENTITY_INSERT dbo.Test ON
INSERT INTO [dbo].[Test]
           (ID,[Name])
           VALUES (1, 'Test1')
SET IDENTITY_INSERT dbo.Test OFF
Msg 102, Level 15, State 12, Line 7
Incorrect syntax near 'IDENTITY_INSERT'.
Msg 102, Level 15, State 12, Line 11
Incorrect syntax near 'IDENTITY_INSERT'.
  • PraveenVeli's avatar
    PraveenVeli
    5 months ago

    Hi deborshi_nag ,

    This is when we want to specifically insert data into the Identity column—not always, but when we need to add particular default records to that table. Got some help from Microsoft, and it looks like that feature will be available within the next two weeks.

4 Replies

  • Hello PraveenVeli 

     

    You don't need SET IDENTITY INSERT ON/OFF statements. Just ignore the identity column in your INSERT statement. 

     

    INSERT INTO [dbo].[Test]
               ([Name])
               VALUES ('Test1');
     
    • PraveenVeli's avatar
      PraveenVeli
      Advocate I

      Hi deborshi_nag ,

      This is when we want to specifically insert data into the Identity column—not always, but when we need to add particular default records to that table. Got some help from Microsoft, and it looks like that feature will be available within the next two weeks.

  • v-ssriganesh's avatar
    v-ssriganesh
    Community Support

    Hello PraveenVeli,

    Thank you for sharing this information. If and when this capability becomes available, it will certainly be helpful for other community members who encounter similar scenarios.

    For now, the current documented behavior still applies, and any updates will be reflected in the official Microsoft Fabric documentation once released.

    If you have any other questions or run into additional issues, feel free to reach out to the Microsoft Fabric Community.