Trigger**

From: maryam rezvani (rezvani_at_parskhazar.net)
Date: 11/25/04


Date: Thu, 25 Nov 2004 09:26:05 +0300

Hi

I've a following trigger which is fired in update status and make all
changes
to a new table successfully,I've a question:
I just want by changing the emp_name column in first table the emp_name in
second
table changes(this happen by login L1 which has permission to the
destination table)
,but when I change the emp_status (by another login which has not access to
the second
table,an error occurred that you have no permission to update the second
table) and that's
correct,but how can I solve my problem ? I don't want to permit the login L2
to the destination
table,but I don't want to recieve such an error like this too,

Any help would be greatly thankful

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

create TRIGGER dummy1
 ON [dbo].[emp1]
FOR UPDATE
AS
update emp2 set
emp_name= (select emp_name from inserted)
where
emp_cod= (select emp_cod from inserted)

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO



Relevant Pages

  • Re: Logon triggers
    ... it's not that if you mess up the login trigger that no one can ... You can still connect on the DAC (Dedicated Administrator ... Connection) to drop the trigger. ... Event Notifications since in the future I want to log DDL & SQL Config ...
    (microsoft.public.sqlserver.security)
  • Re: Creating a Trigger on Access
    ... I don't think a 'SELECT' trigger would be a good idea since data could be ... access for reasons other than login. ... a stored procedure would be the ... DECLARE @ReturnCode int ...
    (microsoft.public.sqlserver.security)
  • Re: are triggers atomic?
    ... If I write a trigger for a file, ... fact that it will conclude before another login on say port ... Maybe I should have been using a readu lock in my ...
    (comp.databases.pick)
  • Re: Column level security
    ... "GRANT INSERT ON TO ... " i.e. i want to grant insert permission ... Regards, ... >columns, a trigger would work nicely, either an AFTER ...
    (microsoft.public.sqlserver.security)
  • Re: Column level security
    ... "GRANT INSERT ON TO ... " i.e. i want to grant insert permission ... Regards, ... >columns, a trigger would work nicely, either an AFTER ...
    (microsoft.public.sqlserver.security)