If you use sql server, can find syntax and sample code in books online.