Well, two things that I noticed: 1) unnecessary use of a Cursor, and 2) "From syslogins" is invalid in 2005, should be "From sys.syslogins".
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]