Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 executing a stored procedure

Author  Topic 

anilr499
Starting Member

18 Posts

Posted - 2012-06-26 : 21:20:49
hi,

i have a store procedure which requires one input
"prj_id" ...

now i want to execute this SP for all my prj_id from project

table...i had written like this....

declare @prj_id varchar(100) = ''
while @prj_id <(select max(prj_id) from project)
begin
select @prj_id = min(prj_id) from project where prj_id > @prj_id
INSERT INTO SPITABLE
exec SP_MTR_TIMELINES_SPI_NEW '@prj_id'
end

now am getting an empty table ....
can some body suggest me whats the mistake....

thank you...
   

- Advertisement -