Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting into a linked server via a stored procedure

Status
Not open for further replies.

MarkGreen

Technical User
Oct 4, 2002
40
GB
I have a very simple stored procedure:

CREATE PROCEDURE [dbo].[copier] AS
INSERT INTO [DISS EMAIL]...(mailto, mailfrom)
SELECT TOP 1 mailto, mailfrom
FROM [EMAIL]
ORDER BY email.id DESC
GO

This is used to simply copy the most recently added record from the "email" table on SQL server 2000 to a linked server table in an access database.
If i run this procedure from query analyser then it works fine. However, I need it to be triggered when an insert occurs on the local SQL email table.
I have tried either calling this procdure from an AFTER trigger or doing an insert from scratch in the trigger but both cause an error: ODBB insert into linked table "email" failed

I have no idea how to solve this. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top