Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

problem with critiria in insert trigger

$
0
0
i have the following trigger:
USE [Parcels]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[trgAfterUpdate] ON [dbo].[ITEMS]
AFTER INSERT

AS
declare
@BARCODE varchar(35),
@itemno int,
@PID VARCHAR(50)

set @BARCODE =(SELECT Barcode from inserted)
set @itemno = (select itemno from inserted)
set @PID = (SELECT PID from DBO.V_DataImport WHERE itemno = @itemno)

BEGIN
INSERT INTO DBO.FOR_IMPORT(ITEM_NO,MAILITM_FID, MAILITM_PID) VALUES (@itemno, @BARCODE, @PID)
END

and the MAILITM_PID field it is not inserterted!! why? somthings wrong with
set @PID = (SELECT PID from DBO.V_DataImport WHERE itemno = @itemno) ??

Please help me!!!!!!!!!!!:eek:

Viewing all articles
Browse latest Browse all 13329

Latest Images

Trending Articles



Latest Images