Home > Archive > MS SQL Server New Users > March 2005 > Trigger on Insert for Linked Server









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Trigger on Insert for Linked Server
Brian Shafer

2005-03-30, 7:04 pm

Hello,
I am new to MSSQL. A vendor sent me a script to put in for a trigger. What
its suppose to do is when a new record is inserted, inserts data on an oracle
database table. The linked server is working.
here is the syntax
CREATE TRIGGER AFTER_INSERT_PD ON [PD-ROLLS-STAT]
FOR INSERT
AS
set xact_abort on
--Delete from openquery (oracle, 'select * FROM RM_RM_RS_PD_ROLLS') Where
ROLL_NB IN (Select [roll nb] From deleted )
insert into openquery (oracle, 'select ROLLING_MILL , ROLL_TYPE ,
ROLL_MATERIAL,ROLL_N
B,SUPPLIER_ID , MANUFACTER_NUMBER ,
ORDER_NUMBER,DATE_RE
CEIVED,
PRICE,NEW_ROLL_DIAME
TER,STATUS,STAND,SCR
AP_DIAMETER FROM RM_RM_RS_PD_ROLLS ')
select [rolling mill],[roll type], [roll material],[roll nb],[supplier
id],[manufacture id],[order number],[date received],[price],[n
ew roll
diameter],status,sta
nd,[scrap diameter] from inserted

all table names and field names are correct.
Any ideas.. I get 7321 and error.
thanks,
Brian
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com