Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with Trigger

Author  Topic 

cmschick
Starting Member

20 Posts

Posted - 2006-03-29 : 09:54:40
I have an INSTEAD OF INSERT trigger that I cannot get to save. The syntax check comes out fine but I get the error message "Stored procedure definition must include name and text (for standard StoredProcedure)...."

What is wrong with this trigger definition? Thank you.

CREATE TRIGGER ustr_InsertPatientPhoneEmail
ON vwPatientPhoneEmail
INSTEAD OF INSERT
AS
BEGIN
-- Make sure the inserted data updates the junction table.

INSERT INTO PatientPhone (PatientID, PhoneID, EmpCreated, DateUpdated, EmpUpdated)
SELECT
inserted.PatientID, SCOPE_IDENTITY() AS PhoneID, inserted.EmpCreated, inserted.DateUpdated, inserted.EmpUpdated
FROM inserted
COMMIT TRANSACTION
END


The Schickster
   

- Advertisement -