I need to pass some parameters for a nested stored proc. Here is my scenario. Proc1 is main stored proc. I am calling another stored proc called Proc2 inside Proc1. When I am passing the same parameters for both the procs. I am getting error.
Here is my stored proc – any help will be appreciated.
Create Procedure Proc1(
@fname varchar(20),
@lname varchar(20),
@adr varchar(40),
@city varchar(20)
)
AS
Insert into Address(fname,lname,Adr1,City) values(@fname,@lname,@adr,@city)
exec proc2 @fname,
@lname ,
@adr ,
@city
If this is your real code, you have a couple of simple typos that will give errors:
insertstatement you have type@lanamewhile the parameter is@lname.insertstatement you have an extra,before the the last).Are this the errors you are getting, or are there others? The question lacks details enough to be able to answer.