Hello I have a table called Workers
in my database. Also I have a stored procedure that returns a table with Id
, xml Data
and xml Schema
by Worker.Id
. I want to select all Worker.Id
values and execute this procedure for each Worker.id
. Here is some script:
create table #tmpXmlreturn
(
Id int,
Data xml,
[Schema] xml
)
select dbo.Workers.Id as Id,
Exec dbo.GetBranchByWorkerId Id,
into #temptable from
dbo.Workers
If you need me to provide more information please tell me.
Best Answer
This should do what you need.