To alter a constraints we need to drop that constraints first.
then recreate that constraints.
Follow this syntax, to Drop Constraints.
ALTER TABLE [dbo].[TableName] DROP CONSTRAINT
[FK_Config_ConstraintsName]
Follow this syntax, to Create a new Constraints.
ALTER TABLE [dbo].[TableName] WITH CHECK ADD CONSTRAINT
[FK_Config_ConstraintsName] FOREIGN
KEY([Company_Mapping_ID])
REFERENCES [dbo].[Template_Company_Table] ([Template_Company_Mapping_ID])
GO
ALTER TABLE [dbo].[TableName]
CHECK CONSTRAINT
[FK_Config_ConstraintsName]
GO
No comments:
Post a Comment