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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
esobrino
Helper II
Helper II

Data Warehouse Alter Table add default value constraint

I have been trying to add a DEFAULT constraint to a COLUMN.  I saw at least one 2023 post stating to check SQL surface area that, as it read says that the ALTER TABLE is not supported, I added a PRIMARY KEY CONSTRAINT using an ALTER TABLE... it just works and therefore the documentation may need some updates.

 

I have not found any sample or discussion on the use of ALTER TABLE to specify a DEFAULT value.  Since the documentation is not current there may be a way... the samples of ALTER TABLE to add a DEFAULT CONSTRAINT works well in on-prem SQL-SERVER but not in Microsoft Fabric Data Warehouse.

 

Hope that someone have some news about this...

 

 

1 ACCEPTED SOLUTION
AndyDDC
Solution Sage
Solution Sage

Hi @esobrino default constraints are not supported currently as per the documenation here: Primary, foreign, and unique keys - Microsoft Fabric | Microsoft Learn 

  • SQL analytics endpoint and Warehouse don't support default constraints at this time.

There's no news when they will be public either.

 

The ALTER TABLE support in the T-SQL Surface Area documenation states "

  • ALTER TABLE ADD/ALTER/DROP COLUMN

And as you've discovered, ALTER TABLE is supported when creating unique, primary key, and foreign key constraints.

 

T-SQL surface area - Microsoft Fabric | Microsoft Learn

 

I hope that helps

 

-------------------------------------------------------

If my post has been useful, please consider 

provising Kudos and/or accepting as the Solution

-------------------------------------------------------

-----------------------------------------------

 

 

"

"

View solution in original post

1 REPLY 1
AndyDDC
Solution Sage
Solution Sage

Hi @esobrino default constraints are not supported currently as per the documenation here: Primary, foreign, and unique keys - Microsoft Fabric | Microsoft Learn 

  • SQL analytics endpoint and Warehouse don't support default constraints at this time.

There's no news when they will be public either.

 

The ALTER TABLE support in the T-SQL Surface Area documenation states "

  • ALTER TABLE ADD/ALTER/DROP COLUMN

And as you've discovered, ALTER TABLE is supported when creating unique, primary key, and foreign key constraints.

 

T-SQL surface area - Microsoft Fabric | Microsoft Learn

 

I hope that helps

 

-------------------------------------------------------

If my post has been useful, please consider 

provising Kudos and/or accepting as the Solution

-------------------------------------------------------

-----------------------------------------------

 

 

"

"

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Expanding the Synapse Forums

New forum boards available in Synapse

Ask questions in Data Engineering, Data Science, Data Warehouse and General Discussion.

MayFabricCarousel

Fabric Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Kudoed Authors