Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i ma read this record

SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN TRANSACTION;

SELECT * FROM macntmst where ACODE ='A0052'

SELECT * FROM macntmst where ACODE ='A0051'

COMMIT TRANSACTION;

don't allow to update this record other person record

update pharma.dbo.macntmst set ACCAT =00200001 where ACODE ='6101'
Posted
Comments
Maciej Los 22-Jul-14 1:53am    
Sorry, not clear! We can't read in your mind or direct from your screen. Please, be more specific and provide more details.

1 solution

I understand that you need to update the record within the transaction, if it so , try to put that update query within the transaction.

BEGIN TRANSACTION;
update pharma.dbo.macntmst set ACCAT =00200001 where ACODE ='6101'
COMMIT TRANSACTION;
 
Share this answer
 
Comments
manoj s sherje 24-Jul-14 0:47am    
no sir actually i want to tell if any one select this record other person cant not be change this record
Kumarbs 24-Jul-14 1:43am    
Ok. You can put that record in the transaction, until unless you commit/rollback that record no one is available to access that record.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900