RE: I need to capture the cashier that created an inventory.
Hi Lawrence,
Here as example trigger that can be used to automatically update the Phisical Inventory description field, when a new Inventory is created. Just open the SQL Management Studio and create this trigger over the PhisicalInventory table:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[tr_NewPhysInvUpdate]
ON [dbo].[PhysicalInventory]
AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;
UPDATE [PhysicalInventory]
SET [Description] = LEFT((SELECT Cashier.[Name] FROM Cashier
WHERE Cashier.[ID] IN (SELECT TOP 1 CashierID FROM [TimeCard] ORDER BY [ID] DESC)) + ': ' + [Description], 100)
WHERE [PhysicalInventory].[ID] = (SELECT TOP 1 [ID] FROM [PhysicalInventory] ORDER BY [ID] DESC)
END
GO
Of course, this trigger is just a start to create a perfect solution for your needs. Probably you will have to create additional trigger for when the Inventory is updated ('coz the description field can be edited), play with the Description field when second time updated to avoid duplicating the Cashier name, etc., etc.,..., but it's a good start I believe...
Kind regards, A.