Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
pmscorca
Post Prodigy
Post Prodigy

Creating a primary key for a warehouse table

Hi,

I've tried to create a primary key for a warehouse table, using this documented sintax, respect two columns:

ALTER TABLE PrimaryKeyTable ADD CONSTRAINT PK_PrimaryKeyTable PRIMARY KEY NONCLUSTERED (c1) NOT ENFORCED;

The query editor underlines in red the ENFORCED keyword. Why?

Moreover, after executing the ALTER TABLE statement I cannot see any primary keys in a visual mode (f.e. by a particular icon): this represents a serious lack for an user.

Any helps to me, please? Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pmscorca ,

I got a confirmation from internal team that for time being, you can ignore the red unline under ENFORCED keyword. You will be able to execute the query without any issue.

Coming to your second question, at present we don't have any icon notation for primary keys.

However, your suggestion is definitely valuable! We use customer feedback like yours to prioritize future features. The more users who request the ability to customize backgrounds, the higher it moves on our list.

 

Appreciate if you could share the feedback on our Microsoft Fabric Ideas. Which would be open for the user community to upvote & comment on. This allows our product teams to effectively prioritize your request against our existing feature backlog and gives insight into the potential impact of implementing the suggested feature.

 

I hope this information helps. If you have any further queries please do let us know.

Thanks

 

View solution in original post

4 REPLIES 4

I have created primary key on table but looks like it’s not supporting in Fabric warehouse. I have followed fabric documentation while creating primary and foreign key but duplicate records get inserted again and again. Below script used and test.

create table config.test

(c1 int not null ,

c1name varchar(20))

 

ALTER TABLE config.test  ADD CONSTRAINT pk_test

PRIMARY KEY NONCLUSTERED (c1) NOT ENFORCED;

 

insert into config.test values (1,’test’) ---  inserted same records multiple times.

 

 

Documentation link:
Primary, foreign, and unique keys - Microsoft Fabric | Microsoft Learn

Anonymous
Not applicable

Hi @pmscorca ,

Thanks for using Fabric Community.
At this time, we are reaching out to the internal team to get some help on this .
We will update you once we hear back from them.

Anonymous
Not applicable

Hi @pmscorca ,

I got a confirmation from internal team that for time being, you can ignore the red unline under ENFORCED keyword. You will be able to execute the query without any issue.

Coming to your second question, at present we don't have any icon notation for primary keys.

However, your suggestion is definitely valuable! We use customer feedback like yours to prioritize future features. The more users who request the ability to customize backgrounds, the higher it moves on our list.

 

Appreciate if you could share the feedback on our Microsoft Fabric Ideas. Which would be open for the user community to upvote & comment on. This allows our product teams to effectively prioritize your request against our existing feature backlog and gives insight into the potential impact of implementing the suggested feature.

 

I hope this information helps. If you have any further queries please do let us know.

Thanks

 

pmscorca
Post Prodigy
Post Prodigy

Hi, I can see the created primary key using SQL Server Management Studio, a client tool that doesn't represent an integrated experience.

Moreover, when I open the Visual Query Builder I can see the created primary key yet.

In the Data warehouse explorer the primary keys aren't visible; this explorer represents an immediate experience that shows the data types and not the primary keys.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Fabric Update Carousel

Fabric Monthly Update - October 2025

Check out the October 2025 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.