问题描述
假设我需要更新员工如下
CREATE PROC UPDATE_EMPLOYEE
(
@EmployeeID INT,
@EmployeeName NVARCHAR(50)
)
AS
更新员工设置EmployeeName = @ EmployeeName其中EmployeeID = @ EmployeeID
假设我有两个用户A,B
使用存储过程修改或编辑上面员工编号5000字段EmployeeName
B需要修改员工编号5000存储过程上面的字段EmployeeName
i需要阻止用户B使用时间戳修改相同的记录如何从c#代码和sql server执行此操作以及存储过程中接受时间戳的修改
EmployeeTable
EmployeeID
EmployeeName
TimeStampEmp
含义在指定时间后允许其他用户
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
推荐答案
这篇关于如何防止更多用户在同一个记录中编辑我...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!