Hi, I have a simple table
CREATE TABLE tItem (PK_Item INT ITENTITY(1,1) NOT NULL, ItemID VARCHAR(15) NOT NULL)
where ItemID is a generated identifier, generally a number, but can differ by customer and other conditions.
ItemID is a result of EXEC @TempID = pGeneralIdentifierRetrieve NULL, NULL, @ItemType
currently, I have insertion of new records written in a stored procedure and it works fine.
I would like to try to rewrite the insert into INSTEAD OF trigger. I have a single problem - how to reference rows in the INSERTED table so that I can update them with the new ItemID. I understand that I can set it in the AFTER INSERT TRIGGER but that would require the ItemID column to be NULLable.
Thanks for any hints