General information
Forum:
Microsoft SQL Server
Environment versions
SQL Server:
SQL Server 2005
Hi,
Considered that too. But, as I understand it, the Insert has already occurred when the trigger fires so I'm not sure what best to put in the trigger.....
Regards,
Viv
>I guess you'll have to write another trigger for the RowColumns table to validate ColumnId against the Columns table
>
>>
>>I'd tried that but when deleting a row in the Rows table I got a 'The DELETE statement conflicted with the REFERENCE restraint' error.
>>?
>>Thx,
>>Viv
>>
>>>Keep the FK but set ON DELETE NONE
>>>
>>>>
>>>>Thx. Thought that might be the answer ; got it working for cascading the deletes. But that leaves the other half of the equation : How to prevent insertions in the RowColumns table if the ColumnId doesn't exist in the Columns table ?
>>>>
>>>>Regards,
>>>>Viv
>>>>
>>>>>You can replace one of ON DELETE CASCADE to RowColumns with a trigger.
>>>>>
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only