Forum Discussion
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'.
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
- deborshi_nagSuper User
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');- PraveenVeliAdvocate 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-ssriganeshCommunity 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.
- RajeshMAdvocate II
Hi PraveenVeli,
This is a feature I am looking forward to as well, but according to this (https://learn.microsoft.com/en-us/fabric/data-warehouse/identity#limitations) we can't use IDENTITY_INSERT is not supported yet. The IDENTITY column is still in preview as well.
If you find my response useful, please give a thumbs up.