Re: How to automatically insert new records into Child Table using Tri

Tech-Archive recommends: Fix windows errors by optimizing your registry



You can use your table valued function with CROSS APPLY:

CREATE TRIGGER ParentTableInsert
ON ParentTable
FOR INSERT
AS

INSERT INTO ChildTable (ParentID, FullRow)
SELECT I.ParentID, F.FullRow
FROM Inserted AS I
CROSS APPLY dbo.MyParseFunction(I.strInput) AS F;

--
Plamen Ratchev
http://www.SQLStudio.com
.