I, too, don't have a problem with a cursor per se
here; it could be done w/o one, but it's not a big deal for such a limited number of rows.
You should get away from "sysusers", which is also obsolete, but again that's not a killer issue either.
But, the cursor should be optimized with FAST_FORWARD:
declare updateServerroles cursor fast_foward for SELECT name FROM sysusers where name = 'TEST\user'
: Corrected typo.
SQL DBA,SQL Server MVP(07, 08, 09) Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial:
If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them.