Jump to content

Sql Thopes Ravali (Update: Resolved)


Recommended Posts

Posted

i have a table   say person

 

id   name     createdby updatedby

1    rama      X               X

 

next some Y updated   this record

 

id   name     createdby updatedby

1    rama      X               Y

 

I need to add a trigger that    X should not be update a record and RAISEERROR, if already updated by Y.   but except X anyone can update that record .   X, Y values are constant and hardocded.

 

so how to add trigger?

 

CREATE TRIGGER [CheckUpdatedByTrigger]
      ON [dbo].Person
      FOR INSERT,UPDATE
      AS
      BEGIN
            SET NOCOUNT ON
            
            Declare @UpdatedBy nvarchar(150),@ID uniqueidentifier
            Declare @FeedName varchar(150)
            SET @FeedName = 'Y'
            
            --
            
      END

 

update:   using deleted and inserted tables, and if condition checking updated by not = X

Posted

Use Snapshot Isolation Feature..nag-smiling-o_zpsd23b83a3.gif?1367267799

Posted

Use Snapshot Isolation Feature..nag-smiling-o_zpsd23b83a3.gif?1367267799

nenu teammate working okati created..testing now..snapshot isolation aa antha pedha concepts enduku bujja nag-smiling-o_zpsd23b83a3.gif?1367267799

Posted

nenu teammate working okati created..testing now..snapshot isolation aa antha pedha concepts enduku bujja nag-smiling-o_zpsd23b83a3.gif?1367267799

Use seste adhe Easy...sarle nee saavu nuvvu saavu.. manaki Triggers antha concepts Ille... nag-smiling-o_zpsd23b83a3.gif?1367267799

Posted

table level security deeniki malla triggers enduku dba ni adigithe table level security enable chesthadu ga

Posted

table level security deeniki malla triggers enduku dba ni adigithe table level security enable chesthadu ga

 

dba evadu ledu..meme dba :)  .. but memu config lo vaade sql connection string  ki all permissions hai.. 

Posted

dba evadu ledu..meme dba :)  .. but memu config lo vaade sql connection string  ki all permissions hai.. 

meeru config lo vaade user e group lo undho choodu just a group ki a table meedha update permission ivvu (idhi already undhi ippudu me system lo )problem solved ..users out of the group can only read not update 

×
×
  • Create New...