0

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.

Table

Amir Hossain
  • 173
  • 2
  • 14
  • ". I want to insert a data before checking on that constraint on a user defined function in the database" - that's not how they work. – Mitch Wheat Dec 04 '15 at 07:31
  • `I want to insert a data before checking on that constraint on a UDF` and `it follows the constraint or not. and then I will insert that data into that row`. So how many insert you want? – Lukasz Szozda Dec 04 '15 at 07:31
  • @MitchWheat is there any way I could use that constraint name or check clause?? – Amir Hossain Dec 04 '15 at 07:55

0 Answers0