if you have a big enough memory card I suppose you could. I wouldn't use the video features on the D5000 for more than a couple seconds at a time though in less you want to manually focus all through that 2 hours of recording.
I would check the manual. For instance the D90 will max out at 20min in the normal mode and 5 min in HD mode. It may not simply be a limitation of the card. The D5K may be longer but I don't know for sure.