Thanks Erland.
By the way, I forgot to mention in the first post that I'm only
interested in the "GroupName" of the currently logged-on user so the
stored procedure will be returning a single string value only and not
a table. How should the stored procedure return this single value from
the record returned by "sp_helpuser"?
Alvin
Erland Sommarskog <so****@algonet.se> wrote in message news:<Xn**********************@127.0.0.1>...
Alvin Sebastian (as********@cmri.usyd.edu.au) writes: I want to create a stored procedure which will extract the "GroupName"
from the record returned by "sp_helpuser". In order to do this I need
to execute "sp_helpuser" which returns the entire record. I want to
just extract the "GroupName" from the record and return it to my
application. How do I go about this?
Either you access sysusers directly, you can use the INSERT EXEC construct:
INSERT #temp (...)
EXEC sp_helpuser
You need to create #temp so that it agrees with the output from sp_helpuser.