|
 |
sql_language thread: Stored Procedure parameters MSSQL
Message #1 by "Cullan Crothers" <cullan.crothers@w...> on Tue, 25 Jun 2002 15:29:44
|
|
Dear Jay:
Thank you...that worked fine!
Cullan
-----Original Message-----
From: Jay Turner [mailto:jayt@c...]
Sent: Tuesday, June 25, 2002 11:45 AM
To: sql language
Subject: [sql_language] RE: Stored Procedure parameters MSSQL
You need to use dynamic sql:
Create Procedure FilterParams
@filter varchar(255) /*This parameter being the end of the where
clause*/
As
Exec ("Select * From Addressbook Where id < 10 And" + @filter)
This will do what you want.
> -----Original Message-----
> From: Cullan Crothers [mailto:cullan.crothers@w...]
> Sent: Tuesday, June 25, 2002 2:30 PM
> To: sql language
> Subject: [sql_language] Stored Procedure parameters MSSQL
>
> Dear sql:
>
> I am trying to build a stored procedure in MSSQL 7.0 where the
procedure
> excepts 1 parameter (that being the end of a where clause). An example
of
> what I am trying to do is this:
> --------------------------------------
> Create Procedure FilterParams
> @filter varchar(255) /*This parameter being the end of the where
clause*/
> As
> Select * From Addressbook Where id < 10 And @filter
> ----------------------------------------
> I can't get the stored procedure to build like that. I am trying to
build
> the stored procedure with that @filter parameter and call it from my
PHP
> program sending it the rest of the where clause as that parameter's
value.
> I, of course, can code the whole query in PHP and run it, but it is
very
> large and I would like to have a stored procedure built, so that I can
> just pass the last part (the filter part) of the query to it.
> Thanks;
>
> Cullan Crothers
>
> to unsubscribe send a blank email to leave-sql_language-
> 792625D@p...
|
|
 |