In SQL 2005 there are settings on Foreign Keys for Delete Rule and Update Rule.
Each of these has the following options:
You can select the value that is set using sp_fkeys but only a 1 or 0 is returned with the following results for the Delete or Update rule.
Not Set: 1
Set Null: 1
Set Default: 1
Is there any way to determine through a query which of these values is set?
Also if Set Null or Set Default is set is a delete allowed but the child records are left orphaned?
I'm working on a middle tier and want to include these values in the class that represents the table.
DECLARE @RC int
Declare @pktable_name varchar(50)
set @pktable_name = 'tblTableName'
EXECUTE @RC = [DatabaseName].[dbo].[sp_fkeys]