在更新表時,必須有鎖表動作
lock
lock
解决方案 »
- SQL 环境配置 性能监视器计数器要求
- 数据库表的设计
- @ShowPage 中是否存在 'aaa.aspx' sql中怎么写?用if?
- 请教,大虾,两表合并问题
- 如果我在更新一台数据库服务器的数据时,用触发器去更新另一台数据服务器的相应数据,这样的操作是异步的吗?
- 号码扩展
- SQL Updatedata()报错
- 急,update select 语句问题。
- DateTime数据类型比较的问题,心急如焚求解中!谢谢!
- 如何返回的输出参数是结果集?ASP如何读取返回参数?
- 多个跨省份的用户同时对一个表进行操作,比如insert,delete,update,如何性能最优?
- 关于数据库的设计问题?????????
begin tran
declare @str int
select @str=max(id) from .....
insert into sdfsdf (...) values (...)
commit tran
---然后在另几个查询分析器(或不同机器)里输入如上代码,运行出结果就知道了
msgbox("資料表被鎖,請稍後再試.")
else
update table .....
endif
cn.begintransaction
rs.open "select max(id) from ..."......
.......
if err<>0 then
cn.rollback
else
cn.commite
end if
if lock(talbe) then
msgbox("資料表被鎖,請稍後再試.")
else
update table .....
endif
begin tran
declare @str int
select @str=max(id) from .....
insert into sdfsdf (...) values (...)
commit tran
如Delphi
Pass:=False;
while not Pass then
Try
insert into .... values (maxID....)
Pass:=True;
except
maxId:=maxId + 1;
end