I have created the following trigger to update the date field in my table. The problem I have is that when I update one row it update all the rows.
What I am doing wrong?
CREATE TRIGGER NEW_GETDATE1
ON dbo.PROFILE
FOR update
AS
DECLARE @MYDATE DATETIME
SELECT @MYDATE = (GETDATE())
UPDATE dbo.PROFILE
SET DOCUMENT_DATE = @MYDATE
GO
What I am doing wrong?
CREATE TRIGGER NEW_GETDATE1
ON dbo.PROFILE
FOR update
AS
DECLARE @MYDATE DATETIME
SELECT @MYDATE = (GETDATE())
UPDATE dbo.PROFILE
SET DOCUMENT_DATE = @MYDATE
GO