?????????????
???????????? ???????[ 2016/7/11 10:43:06 ] ????????????? ???????????
??????????????
????????д???????????·?????????????????????????????????????????????????????????????????????????ü???????????????????
??????????壺??????????????????£???????????????????????????
???????????????????????????????????????????л?????????????????????????????????????????????????????洢???????????????????????????????????????????????????????в?????????????????????????????????????????????????????????????
???????????????
????????????????????????ü??仰????????????????????????????????????Щ???
????????????????????????????????????????????????????????????????????????????????????????09?????????????????????????????????????????????????
??????????????????PPT?????????????????ЩPPT????????????????????????
????????????????
?????????????????????????????????????????????????????дSQL?????????????????????????
?????????????????????????????????????e?????????????????
SELECT * FROM AppLog WITH (HOLDLOCK) /*??????*/
SELECT * FROM AppLog WITH (UPDLOCK) /*??????*/
SELECT * FROM AppLog WITH (XLOCK) WHERE LogID='AA599A4E-B727-4A65-8010-00001661765E'; /*??????*/
SELECT * FROM AppLog WITH (ROWLOCK) WHERE LogID='6BE2C680-0C9F-43FA-9B4E-00000A6C1CEF'; /*????*/
SELECT * FROM AppLog WITH (TABLOCKX) /*????????????*/
SELECT * FROM AppLog WITH (XLOCK??ROWLOCK) WHERE LogID='AA599A4E-B727-4A65-8010-00001661765E'; /*??????????*/
/*XLOCK ??????????????е??TABLOCKX??????????*/
SELECT * FROM AppLog WITH (NOLOCK) /*???????????????????????????????*/
SELECT * FROM AppLog WITH (READPAST) /*????????????????????????????*/
????????????????
????????????????????????????????
???????1??
????BEGIN TRAN
????SELECT * FROM AppLog WHERE LogID = 'A10BA165-6E52-4AFB-9EA8-000000D6B90A';
????UPDATE AppLog SET AppPostion = AppPostion + AppPostion WHERE LogID = 'A10BA165-6E52-4AFB-9EA8-000000D6B90A';
???????2??
????BEGIN TRAN
????SELECT * FROM AppLog WHERE LogID = 'A10BA165-6E52-4AFB-9EA8-000000D6B90A';
????UPDATE AppLog SET AppPostion = AppPostion + AppPostion WHERE LogID = 'A10BA165-6E52-4AFB-9EA8-000000D6B90A';
???????????1?????2????? SELECT?????1??????????????????2?????????????????????1 SELECT ?????????????UPDATE???????????????????1????????????
????????????????????н???????UPDATE.
????????????????????????????????????????????????????????????е?????????????????????2????????????????????1??(?????2?????????????????????????????????????????????1????????????????????2????????????????
?????壺???????????
???????????????????????????????????
CREATE TABLE a
(
id INT ??
name NVARCHAR(20)
)
BEGIN TRAN
INSERT a VALUES ('1'??'a')--????????????????????????????insert ???????????????????????
???????????????????У?
????select COUNT(*) from a with(nolock)--?????????????????1
????select COUNT(*) from a with(readpast)--??????????????????????0
??????????select * from a –?????鯔???????????????????????????????δ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ?????????????????????????δ???????μ??????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11