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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
pmscorca
Advocate V
Advocate V

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
jagdishwagh0909
Frequent Visitor

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
Advocate V
Advocate V

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
May FBC25 Carousel

Fabric Monthly Update - May 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.