Learn more about SQL Server tools

mssqltips logo
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

 
Best Practices for Migrating SQL Server to Azure - free webinar
 

The Ins and Outs of SharePoint Document Check-In and Check-Out


By:   |   Last Updated: 2010-10-13   |   Comments   |   Related Tips: > Sharepoint

Problem

SharePoint is a collaborative platform. A central feature is the ability to share documents with other users. But what if multiple users try to edit the same document at the same time? This can lead to versioning conflicts and confusion about changes. How can this be prevented?

Solution

SharePoint provides a feature called document Check-In and Check-Out. The purpose is to exclusively lock a document for modification by a user. Once the changes are complete the user can check-in the updated document to release the lock and make the changes visible to other users.

When you check-out a document, you get an exclusive lock to edit that document and can be sure no other users can make any changes to the same document. Though other users can read the document, they will not be able to edit it or even will see your changes unless you check-in the document. While a document is checked-out, you can edit it, close it, reopen it, even work offline with it. Once your required changes are done you can check-in the document to release the exclusive lock which you had for document editing. Your changes are then available to other users. While checking-in the document you can also specify a comment about the changes to help others understand what has changed.

If the version control feature is enabled, this comment will become part of document version history, so if needed you can revert back to an older version by looking at the comment. (I will be talking in detail about version control in a future tip.)

There might be a time after checking out a document where, where you want to discard your changes, even after saving them. You can then discard your changes by un-doing a check-out.

Example

Click on the dropdown (arrow) icon on the document as shown below, then click on the Check-Out option to check out the document (this gives you an exclusive write lock on the document).

In SharePoint 2010, you can also check out a document by selecting a document in the library and then clicking on Check-out option in the Documents ribbon (2nd image below).

When you make changes to a checked-out document, the document is stored by default on your hard disk in a drafts folder that is in your "My Documents" folder (when using WSS 3.0) or with SharePoint 2010, the default location is the web server. The location of the local cached copy is configurable. (That, however, is outside the scope of this tip.)

library tools
check out

Once a document is checked-out it will be indicated with a tiny down arrow icon as shown below. If you hover the mouse pointer on it, then it will show who has checked out that document.

project plan

Once you have checked out a document, you can open and edit it. The moment you save and close the document, you will be prompted with the below alert. If you select "No" the changes you make to the document will be available locally only to you. No other users will be able to see those changes unless you check-in the document (by clicking "Yes").

microsoft word

While checking-in your document you can specify any comments about the changes you have made to the document. If Version Control is enabled for the document library, this comment will become part of version history and will be quite helpful.

Looking at the different comments in the version history can help you choose the right version when reverting back to older version. While checking-in your document, you also get an option to check in the changes, while at the same time keeping the document checked out. This enables others to see your changes, but you still have the document locked so others cannot make changes.

check in

If the document is already checked out by someone else and you try to check it out, you will be prompted with this message about who has checked-out the document and what options are available to you.

file in use

For example, When I tried to check-out an already checked out document (see below), I was informed that the document is already checked out, by who and when, and then given an option to override the checked-out by that user.

library tools
technical design document

You can operate many of the SharePoint Check Out features directly from MS Office applications as well. Below you can see a checked out document in MS-Word and the options to perform other actions to it.

checked out document
Next Steps


Last Updated: 2010-10-13


next webcast button


next tip button



About the author
MSSQLTips author Arshad Ali Arshad Ali is a SQL and BI Developer focusing on Data Warehousing projects for Microsoft.

View all my tips





Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Email me updates 


Signup for our newsletter
 I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



    



Learn more about SQL Server tools