Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check Constraint
Message
De
30/11/2021 13:14:08
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01682862
Message ID:
01682871
Vues:
31
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform