开发者

DB locking during select, update, insert and delete

开发者 https://www.devze.com 2023-04-04 00:42 出处:网络
I want to understand how locking works in SQL Server (2005/2008) during select, update, insert and delete operations. Specifically, I want to know if Indexes have anything to do with locki开发者_JAVA技

I want to understand how locking works in SQL Server (2005/2008) during select, update, insert and delete operations. Specifically, I want to know if Indexes have anything to do with locki开发者_JAVA技巧ng. I mean, having a primary key helping in locking a row rather than entire table etc., Can someone suggest some articles?

Thanks, Gopal


For SQL Server 2008, you can start with Locking and Row Versioning, and Customizing Locking for an Index.

You can control locking granularity using CREATE INDEX..., ALTER INDEX..., CREATE TABLE..., and ALTER TABLE.... See, for example, the syntax for CREATE INDEX, and search that page for the options ALLOW_ROW_LOCKS and ALLOW_PAGE_LOCKS.

0

精彩评论

暂无评论...
验证码 换一张
取 消