puli_keka Posted March 11, 2015 Report Posted March 11, 2015 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
puli_keka Posted March 11, 2015 Author Report Posted March 11, 2015 Use Snapshot Isolation Feature.. nenu teammate working okati created..testing now..snapshot isolation aa antha pedha concepts enduku bujja
Hyderabad_Nawab Posted March 11, 2015 Report Posted March 11, 2015 nenu teammate working okati created..testing now..snapshot isolation aa antha pedha concepts enduku bujja Use seste adhe Easy...sarle nee saavu nuvvu saavu.. manaki Triggers antha concepts Ille...
DaleSteyn1 Posted March 11, 2015 Report Posted March 11, 2015 table level security deeniki malla triggers enduku dba ni adigithe table level security enable chesthadu ga
puli_keka Posted March 11, 2015 Author Report Posted March 11, 2015 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..
DaleSteyn1 Posted March 11, 2015 Report Posted March 11, 2015 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
Recommended Posts