I have a trigger in SQL that works without errors. Hwoever it does not accomplish the desired behavior. What I am trying to do, is when the user updates the field1 column, take that value, and insert that value and the associated information with that value into a different database table. It does not insert as expected. Here is the Trigger:
ALTER TRIGGER [dbo].[Trigger1]
ON [dbo].[table1]
AFTER UPDATE
AS
BEGIN
SET NOCOUNT ON;
DECLARE @UpdatedVendId CHAR
SELECT
@UpdatedVendId = inserted.VendId
FROM
inserted
IF UPDATE (VendID)
BEGIN INSERT INTO OtherTable (ClassID, Crtd_User, LUpd_DateTime, LUpd_User, VendId) SELECT ClassID, crtd_User, LUpd_DateTime, LUpd_User, VendId FROM dbo.table1 WHERE VendId = @UpdatedVendId
END
END