Skip to main content

Difference between Lock and Nolock


Lock

Lock in  MSSQL is used to prevent concurrent access of tables. It is widely used to application that have large number of users who access database. In case if a user tries to alter a table the table will be in lock state so that no other user can try to alter the table until the lock release. 


In this case User 1 is trying to alter the table in database. User 2 has to wait until the lock is released by user 1. After that User 2 will put lock and execute the query. In case if user fails to use lock it will results in error

Note: Lock is used in DML statement.

Nolock

 Nolock is used so that two or more user can access the table simultaneously.It widely used in DDL statement.


 This is many number of user can select (View) data from table. select statement is similar to read. Where as DML is similar to write. By using nolock the data retrieval speed is increased for the user. There is no need wait until other user data selection ends.

Popular posts from this blog

CONVERTING TORRENT FILE TO ZIP FILE

HOW TO CONVERT TORRENT FILE TO ZIP FILE 1>>click the link below  http://www.zbigz.com   2>>upload your .torrent file  3>>wait until conversion, after conversion your  file can be downloadable in .zip format.

What is the difference between Abstraction and Encapsulation?

I'm sure You came here to see the answer after vising plenty of websites and which is not enough to understand about that concept. The reason why you cant get the perfect or believable answer abut this concept is you're not reading the whole content slowly and carefully. But im sure if you read this fully and carefully, you can earn the knowledge about the difference between Abstraction and Encapsulation. and here we are gonna teach you the real time scenario of Abstraction and Encapsulation. ok!  Lets go to the Topic. What is Abstraction: "Abstraction  is a process of hiding the implementation details and showing only functionality to the user." You could see this answer in many websites. Let me explain about what is implementation and functionality.  For Example, " Dhoni is a cool captain" Cool is his nature it is his Function. He is always cool even the Team is in underpressure. So cool is his Natural Function. And, We dont know how he is so cool in under...

Simple Trick To Convert A Webpage To PDF File

Simple Trick To Convert A Webpage To PDF File In this post i will teach a simple trick or browser feature that let you convert any web page into PDF file format, which might help you to read your favorite articles offline. So lets get start. How To Save Web Page To PDF File ? Step 1: Open the Google Chrome Browser on your PC or MAC  Step 2: Then go to the web page that you want to convert as a PDF.  Step 3: Now press Ctrl+P on Windows pc or Command+P if you are on a Mac to Open the the Print dialog on Chrome Browser.  Step 4: Now Change the destination to “Save As PDF” and hit the save button. Step 5: The current web page will instantly be downloaded as a PDF document.