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)
 Stored Procedures Parameters

Author  Topic 

OASISv2
Starting Member

1 Post

Posted - 2004-05-28 : 09:35:32
Hi,

Does anyone know how to pass a parameter that will be dynamically selected by an end user (not hard coded) via a VB form front end to a Stored Procedure on the backend SQL database? The parameter is text. I specifically need to see how the code would look.

Thanks,
OASIS

danielhai
Yak Posting Veteran

50 Posts

Posted - 2004-05-28 : 15:15:40
you're going to have to declare all your input parameters, no matter what they be.

Even so, you could get sort of close. -

CREATE PROCEDURE sp_sdflkjslk

@param1 int = null,
@param2 int = null,
@param3 int = null,
@param4 int = null

AS

select 1 from table where
isNull(@param1,param1) = param1 and
isNull(@param2,param2) = param2 and
isNull(@param3,param3) = param3 and
isNull(@param4,param4) = param4
Go to Top of Page
   

- Advertisement -