SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 executing a stored procedure
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

anilr499
Starting Member

18 Posts

Posted - 06/26/2012 :  21:20:49  Show Profile  Reply with Quote
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...
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000