I have two table
One table is Systemcode (ID Uniqueindetifier , name NVARCHAR(50))
Second table is calldesk (type NVARCHAR(50),systemid Uniqueindetifier)
Now there may a system level call or non system level call.
when there is system level call i have to insert one record in calldesk with proper system id (present in systemcode)
and when there is non system level call i have to insert one record in calldesk with empty system id (0000-0000......)
Now to validate the first level i need to create FK between systemid form calldesk to id from systemid with check condition of second level because there is not such record in systemid table with empty id (0000-000....)
Also i can not insert the empty id systemid table.
also i can not check this from SP . because there is already 500 SP which will insert the data into call desk from same level.
can i achieve this with check constraint. ?