Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check Constraint
Message
 
To
30/11/2021 07:43:44
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01682862
Message ID:
01682867
Views:
36
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.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform