SQL Server Performance

Store Proc

Discussion in 'General Developer Questions' started by Reddy, Jul 20, 2005.

  1. Reddy New Member

    Hi Guys!
    I have 3 parameters declared in my SP, what I want is though i am not supplying 1 of the parameter to SP it shud execute as usual, is it possible for me?

    Actually I am using this SP for my sql reports where i want to select parameters from drop down list. For example I have deptno and actno as parameters,if i am selecting deptno and actno it shud display only those reports, if i am selecting only deptno then it shud display reports of all actno under that dept.

    Can any one please help me regarding,Its damn urgent.
  2. Chappy New Member

    Set default values for omitted parameters...

    create procedure dbo.mytest @int1 int, @int2 int = 12345, @int3 int = 67890


    exec dbo.mytest 100
    exec dbo.mytest 100, 200
    exec dbo.mytest 100, 200, 300

Share This Page