General discussion
January 10, 2006 at 12:30 PM
thomas.bihn

Trigger output

by thomas.bihn . Updated 20 years, 9 months ago

I’d like to use a trigger to identify the GUID that was assigned to a record just inserted. Here is the TRIGGER statement:

CREATE TRIGGER trigBoardsGUID
ON [EngineeringUser].[Boards]
FOR INSERT
AS
BEGIN
SET NOCOUNT ON

SELECT Board_GID AS ‘@@GUID’
FROM inserted
END

How do I access ‘@@GUID’ from my stored procedure that inserts into Boards?

I was using an ID field (int identity) but need to synchronize this table with another database server. I’m using Scope_Identity() to determine the last record ID added, but need to do this method to determine the last record GUID.

Thanks

This discussion is locked

All Comments