Friday, October 14, 2011

SQL Trigger Error - The row value(s) updated or deleted either do not make the row unique or they alter multiple rows (2 rows).

The row value(s) updated or deleted either do not make the row unique or they alter multiple rows (2 rows).

Put SET NOCOUNT ON  as following:-
 

Create TRIGGER [dbo].[OBIEE_USERSTRI_DEL]

ON

[dbo].[WC_OBIEE_USERS]

FOR

DELETE

AS

SET

NOCOUNT ON

BEGIN

DECLARE

@USERNAME1 VARCHAR(100)

DECLARE

@GROUPNAME1 VARCHAR(2000)

SELECT

@USERNAME1 =USERNAME,@GROUPNAME1=GROUPNAME FROM Deleted

insert

into WC_OBIEE_AUDIT(USERNAME,GROUPNAME,USERID,DATEUPD,WORKSTN,[ACTION])

select

@USERNAME1,@GROUPNAME1,SYSTEM_USER,getdate(),host_name() ,'Delete'

END

 



No comments: