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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How exec or call procedure from another procedure

Author  Topic 

iswan
Starting Member

28 Posts

Posted - 2007-06-11 : 06:39:08

I want to execute procedure 2 with in the Procedure 1.

Procedure 1:
CREATE PROCEDURE scspInsTmplField AS

declare @RdCount int;
declare @LpCount int;
declare @FldNam varchar(100);
declare @FldType varchar(100);
declare @FldLen int;

set @LpCount=1;


select @RdCount=count( *) from scTabTmplField
scspCreateFormField;
--PRINT @RdCount;

while(@LpCount<=@RdCount)
begin

select @FldNam=FieldName,@FldType=FieldType,@FldLen=FieldLen from scTabTmplField where Id=@LpCount

print @FldNam+' '+@FldType
--exec scspCreateFormField(@FldNam,@FldType,@FldLen)
scspCreateFormField(@FldNam,@FldType,@FldLen)
set @LpCount=@LpCount+1;

end
GO

Procedure 2:
CREATE PROCEDURE scspCreateFormField @Dname varchar(50) , @Dtype varchar(50), @Length int, @Errorid int=null output as

...
Go


Regards
Iswan




harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-06-11 : 06:43:59
quote:
Originally posted by iswan


I want to execute procedure 2 with in the Procedure 1.

Procedure 1:
CREATE PROCEDURE scspInsTmplField AS

declare @RdCount int;
declare @LpCount int;
declare @FldNam varchar(100);
declare @FldType varchar(100);
declare @FldLen int;

set @LpCount=1;


select @RdCount=count( *) from scTabTmplField
scspCreateFormField;
--PRINT @RdCount;

while(@LpCount<=@RdCount)
begin

select @FldNam=FieldName,@FldType=FieldType,@FldLen=FieldLen from scTabTmplField where Id=@LpCount

print @FldNam+' '+@FldType
--exec scspCreateFormField(@FldNam,@FldType,@FldLen)
EXEC scspCreateFormField @FldNam, @FldType, @FldLen
set @LpCount=@LpCount+1;

end
GO

Procedure 2:
CREATE PROCEDURE scspCreateFormField @Dname varchar(50) , @Dtype varchar(50), @Length int, @Errorid int=null output as

...
Go


Regards
Iswan








Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

iswan
Starting Member

28 Posts

Posted - 2007-06-11 : 06:55:59
Thanks
Go to Top of Page
   

- Advertisement -