Just to be clear, Chris was trying to get the OP to teach themselves how to answer such simple questions on their own instead of making them permanently dependent on the kindness of others on the web. Books Online is a very good tool for learning such basics and more. I'm amazed at how many people that are using SQL Server that don't even know what Books Online is.
@Gautham.gn,
Two questions for you now that you have the coded answer to your question... 1) Do you understand all of the parts of that code and why it works and 2) do you know what Books Online actually is?
--Jeff Moden
Change is inevitable... Change for the better is not.