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)
 sp creation

Author  Topic 

vin
Starting Member

26 Posts

Posted - 2003-03-28 : 00:58:04
hi,
I have to write a SP, for which the inparameters may differ.
For example ther user may pass 1 to 25 parameter.
How to go abt this.


samsekar
Constraint Violating Yak Guru

437 Posts

Posted - 2003-03-28 : 02:29:34
You can create a Stored Procedure which can hold default values for all the 25 parameter and manipulate accordingly inside the procedure.

Create Procedure Test
@p1 int=0, @p2 int=0, @p3 int=0, ...

Sekar
~~~~
Success is not a destination that you ever reach. Success is the quality of your journey.
Go to Top of Page

vin
Starting Member

26 Posts

Posted - 2003-03-28 : 04:11:14
Thanx samsaker,

all that i have to do is user sends some column names and i have to use those column name in my select statement.

suppose in emp table, he send ename,empno ..
i need to do select * from enam,empno thats it.

for this, should i use if else 25 times and check whether it is null or not and use the select * statement or
is there any other logic which i can use


Go to Top of Page
   

- Advertisement -