2007年11月19日 星期一

在ASP中使用SQL LOCK TABLE範例

Set XACT_ABORT ON
Begin tran
Select @SNO = strNum from test With (XLOCK) Where strYMD = @SToday
Update test set strNum = strNum + 1 where strYMD = @SToday
if @@Error <> 0
Rollback Tran
else
Commit Tran
Set XACT_ABORT OFF