|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, December 04, 2012 8:00 AM
Points: 13,
Visits: 14
|
|
i have using two query in stored procedure, i want to use insert query in some time only alter proc proc_emp1 @i int, @pempid int,@pempname varchar(30),@pm1 int,@sm1 int as print @i if @i<=1
begin --if @i='I' insert into emp1(empid,empname,m1)values(@pempid,@pempname,@pm1) end
if @i>=1
begin update emp1 set m1=@sm1 where empname='laila' end
execute procedure: exec proc_emp1 @i=0,@pm1=44,@pempid=3,@pempname='khan' error: Msg 201, Level 16, State 4, Procedure proc_emp1, Line 0 Procedure or Function 'proc_emp1' expects parameter '@sm1', which was not supplied.
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: 2 days ago @ 1:17 PM
Points: 8,641,
Visits: 8,273
|
|
boobalanmca07 (12/4/2012) i have using two query in stored procedure, i want to use insert query in some time only alter proc proc_emp1 @i int, @pempid int,@pempname varchar(30),@pm1 int,@sm1 int as print @i if @i<=1
begin --if @i='I' insert into emp1(empid,empname,m1)values(@pempid,@pempname,@pm1) end
if @i>=1
begin update emp1 set m1=@sm1 where empname='laila' end
execute procedure: exec proc_emp1 @i=0,@pm1=44,@pempid=3,@pempname='khan' error: Msg 201, Level 16, State 4, Procedure proc_emp1, Line 0 Procedure or Function 'proc_emp1' expects parameter '@sm1', which was not supplied.
Not really sure what the question is here but the error message tells you EXACTLY what the problem is. You are calling proc_emp1 and not providing @sm1. Either give that parameter a default value in the proc or add it to the call.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Moden's splitter.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
|
|
|
|