Me again...
I was in need of having an "Account" point to another "DebitThisAccount" for billing purposes.
So, I created a column in my Accounts table which is a Foreign Key to itself, it's own unique identifier called "DebitThisAccount".
It's NON NULL, with no Default value.
Fine.
Now the problem...
I'd like to:
1) Keep the column as NOT NULL
2) Keep a RI Foreign Key to the same table
(From the one account column to the Unique identifier - a self-join)
3) When a new account is INSERTED - take the new Accounts Identity and insert it into itelf as "DebitThisAccount".
AS it stands - I have to:
1) Make the column NULL
2) Create an After Insert Trigger to get the new identity.
3) Create an Update Trigger to make sure the change to the "DebitThisAccount" column is not NULL.
Am I running in circles for no Reason ????
Thanks in advance - B