USE [BPOptical] GO /****** Object: Trigger [dbo].[Transfers_Insert_AdjustItemQty] Script Date: 11/07/2013 02:17:31 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= CREATE TRIGGER [dbo].[Transfers_Insert_AdjustItemQty] ON [dbo].[transfers] AFTER INSERT AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; DECLARE @Quantity int SET @Quantity = (SELECT trn_qty FROM inserted) DECLARE @ItemId char(16) SET @ItemId = (SELECT trn_itmfk FROM inserted) -- Insert statements for trigger here UPDATE dbo.Items SET Items.iqtyonhand = Items.iqtyonhand - @Quantity WHERE iitemid = @ItemId AND iItemTypId = '43' -- 43 is for Inventory items END GOIs there something wrong with my logic here resulting in a null value?