Can I go all the way by train and how long does it take. also, do you recommend breaking up the journey and stopping over somewhere.I have signed up for the euro rail pass second class
No problems, there are several trains every day between Copenhagen and Stockholm. The journey takes about 5-6 hours, but seat reservation may be mandatory on some connections. Try to catch the "X2000" high speed train which runs daily between these two cities - will make you journey more pleasant.
Depending upon your departure time, you can take a direct X2000 train or you can take a regiional train part way and a X2000 train the rest of the way. With a railpass you will have to buy a seat reservation for any X2000 train. See the detailed timetables on the German Rail site.