• read this fantastic article carefully. This may help you

    http://www.sqlservercentral.com/articles/T-SQL/62867/