• Ah, sorry, didn't realize this was a SQL 2000 instance.

    You could use something like prasenjit221's code. I don't have a SQL 2000 instance handy to test, but that looks compatible. Depending on OS, I might use Powershell or VBscript instead and have those languages insert the data into a table that you can query. That's because I've found I don't usually need this in real time. I might have a job that updates this once a day or once an hour.