in 2nd SP
create table #temp1 (all required fields typically which your SP1 is going
insert into #temp1 (field list)
This will insert data into #temp1 table which you can use, the way like.
Hope this make some sens, in case, post the DDL of tables, SP1 and SP2
> thanks for the quick reply!
> I'm pretty much an absolute beginner on this, so need a bit more help!
> What would the syntax be for calling the first SP from the second, for
> User in the Users Table?
> obviously, Select UserID from Users, but then where would i put the "exec
> sp_GetUserRolesList Users.UserID" bit ?
> > from the 2nd SP, you need to create the temp table and get the results
> > the 1 SP into that then combine both and send back to client application
> > HTH
> > Falik
> > > Hi
> > > I'm sure this question has been answered many times before, but i've
> > no
> > > luck finding an answer yet!
> > > I have one stored procedure (sp_GetUserRolesList) that returns a
> > > (RoleList) containing the groups that a user belongs to e.g. 'Clients,
> > > Admins, Testers'. This procedure has one param - UserID.
> > > I have another procedure, GetAllUserDetails, that i want to return
> > columns:
> > > Users.UserName, Users.UserCompany etc. (from Users table) and RoleList
> > (from
> > > sp_GetUserRolesList).
> > > The data i want would be something like:
> > > UserName | UserCompany | RoleList
> > > Fred | ACME | Clients, Testers
> > > Bill | Connex | Clients
> > > Jon | ACME | Admins, Testers
> > > How do i go about doing this? I've looked all over the place, am i
> > supposed
> > > to use a temp table?
> > > Seems like such a simple problem!
> > > thanks in advance
> > > Rik