Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check Constraint
Message
From
30/11/2021 13:14:08
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01682862
Message ID:
01682871
Views:
30
Thanks Martina!

>Hi,
>
>If db is empty, then the command is unnecessary.
>
>PostgreSQL has equal command:
>https://dba.stackexchange.com/questions/62739/how-do-i-validate-all-my-constraints-in-postgresql
>
>MartinaJ
>
>>Thanks. So it doesn't actually create the check constraint, it just runs it to verify the data?
>>
>>Why I am asking is because I am converting a SQL Server database to PostgreSQL by scripting the SQL Server database out and then adjusting the script to PostgreSQL syntax and it doesn't like that CHECK CONSTRAINT command. As this is a empty database I am creating I guess I don't need to actually check that the constraint is valid.
>>
>>>Hi,
>>>
>>> Runs check if data are consistent.
>>>
>>> MartinaJ
>>>>Hi,
>>>>What exactly does the CHECK CONSTRAINT command in the following do?
>>>>
>>>>
>>>>ALTER TABLE public.salesdetails  ADD  CONSTRAINT FK_salesdetails_sales FOREIGN KEY(isaleid)
>>>>REFERENCES public.sales (isaleid)
>>>>;
>>>>ALTER TABLE public.salesdetails CHECK CONSTRAINT FK_salesdetails_sales
>>>>;
>>>>
>>>>This is code generated by SSMS.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform