View Single Post
  #1 (permalink)  
Old October 1st, 2004, 11:45 AM
mcinar mcinar is offline
Friend of Wrox
Join Date: Jun 2003
Location: , NY, USA.
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default Passing a parameter value to Stored Procedure

Hi All,

I am using VB 6.0 with SQL Server 2000
and I am trying to pass a string value to a stored prcodeure to use
in "WHERE" clause.


In VB:
strWhere = "StateID = 1"

By using the "Command Object", I pass "strWhere" parameter

In Stored Procedure:
create up_parmSel_state
    @strWhere as varchar(255)
 select *
   from State_T
   where @strWhere

* That's what I am trying to accomplish, but it does not work.
* I know that there is an other way by using some type of SQL Function to make it work in the Stored Procedure,
but I don't remember it now.

Thank you in advance.

Love all the creatures because of the creator.
Reply With Quote