Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent more user from edit in same record proplem

Status
Not open for further replies.

ahm1985

Programmer
Dec 6, 2012
138
EG
suppose i need to make update the employee as following
CREATE PROC UPDATE_EMPLOYEE
(
@EmployeeID INT,
@EmployeeName NVARCHAR(50)
)
AS
update Employee set EmployeeName=@EmployeeName where EmployeeID=@EmployeeID
Suppose I have two useres A,B
A modified or edit using stored procedure above employee no 5000 field EmployeeName
B need to modify employee no 5000 using stored procedure above field EmployeeName
i need to prevent user B To modify same record using time stamp How to do that from c# code and sql server and what modification in stored procedure to accept timestamp
EmployeeTable
EmployeeID
EmployeeName
TimeStampEmp
Meaning allow to another user after specified time
 
can any one answer for me in this question
 
You don't give any indication of what versions of VS and SQL Server you are using, but look in SQL Server's BOL (Books On Line) - help file - for details on Transactions and on Locking and you should find a number of solutions to your problem specific to your version.
 
version of sql is sql server 2005
and visual studio 2008
 
As I suggested use BOL and look up both Transactions and Locking - using one or both should help resolve your issues.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top