Hello All,
I have to write a update trigger on a table.
The table structure is some what like this
Study
Site (PK,FK)
Study (PK,FK)
VendorID
StudyPro
Site (PK,FK)
Study (PK,FK)
SeqNo (PK)
CustID
Protocol
Materials
CustID (PK)
Protocol (PK)
Material (PK)
The trigger should be on Update(CustID, Protocol) in StudyPro table
I have to insert the record from inserted in Materials table if the CustID and Protocol columns (StudyPro table) only for VendorID = 3 (Study table) are updated
And then delete the record from Material using deleted table only if that Protocol is not been used by any other study(StudyPro) where the VendorID = 3
I am confused on the deleted SQL. Can any one please help on how I should be handling this update trigger?
Any comments ot advice will be really appreciated
Thanks in advance
-techiPA
I have to write a update trigger on a table.
The table structure is some what like this
Study
Site (PK,FK)
Study (PK,FK)
VendorID
StudyPro
Site (PK,FK)
Study (PK,FK)
SeqNo (PK)
CustID
Protocol
Materials
CustID (PK)
Protocol (PK)
Material (PK)
The trigger should be on Update(CustID, Protocol) in StudyPro table
I have to insert the record from inserted in Materials table if the CustID and Protocol columns (StudyPro table) only for VendorID = 3 (Study table) are updated
And then delete the record from Material using deleted table only if that Protocol is not been used by any other study(StudyPro) where the VendorID = 3
I am confused on the deleted SQL. Can any one please help on how I should be handling this update trigger?
Any comments ot advice will be really appreciated
Thanks in advance
-techiPA