I'm working on a sql server database to populate fake data with faker-factory in python. Let's say I have a table named TABLE_OTHER with a column F1 of datatype int. And there is a check constraint name CHK_F1 with clause F1>0. I want to insert a data before checking on that constraint on a user defined function in the database. suppose I call that function with a value of -2 and then it would check the value using this check clause or constraint name. And it will return a status signal whether it follows the constraint or not. and then I will insert that data into that row.
So how do i use a check clause or constraint name in a stored function or procedure to verify data integrity?? Let me know if there is any query I'll comment right away. Thanks in advance.