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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 error referencing 'inserted' table in trigger

Author  Topic 

Posting Yak Master

179 Posts

Posted - 2001-05-30 : 12:30:53
I have sp that inserts data from asp page and a trigger that fires email to inform us of the insert. I'm getting an 'invalid object name' for the inserted table when I try to reference it in the trigger. Am I not correctly using 'inserted' ?? Below is trigger and sp

CREATE TRIGGER mail_data_request ON Requests
exec master.dbo.xp_sendmail '', @query = 'DataRequests.dbo.sp_data_request_query',
@subject = 'new data request'

Query Stored Proc
CREATE PROCEDURE [sp_data_request_query]
select ins.FirstName + ' ' + ins.LastName + ', ' + ins.title + ' of ' +
ins.Organization as Requestor, ins.request_info as Requests, as email,
ins.ph_area_code + '-' + ins.ph_prefix + '-' + ins.ph_suffix as phone
from inserted ins

Thanks a lot


- Advertisement -