Ask a Question related to ASP Database, Design and Development.
-
john Smith #1
Passing "%" wild card to stored procedure
Hi everyone,
This may be a simple question: When I pass "%" (without the quotes) in an
asp page to a stored procedure, I get the
Incorrect syntax near '%'.
message. I get the same message from the query analyzer, if I dont use the
single quotes. I cannot encase the % sign in single quotes or even double
quotes in the asp page. Is there a way around this?
Thanks for your help,
John
john Smith Guest
-
passing values to stored procedure
Hello Can some please let me know how can I pass value to the following stored procedure from coldfusion template. It is written in different... -
Passing null into a stored procedure
I have a survey form with both checkboxes and radio buttons... when storing the form, there are occassions that I need to store a NULL in the DB and... -
SQL Stored Procedure Problem "Single Quotes"
Quotes is something we all should be aware of when passing values to a Stored Procedure. However, this specific scenario I am really stuck on. ... -
Can "Computed Column" be a stored procedure in SQL Server 2000?
I am looking forward suggestions and solutions. I have a table and would like to add a "computed column" for reporting performance reason. The... -
Passing arrays to a stored procedure
http://www.aspfaq.com/2248 http://www.algonet.se/~sommar/arrays-in-sql.html http://www.algonet.se/~sommar/dynamic_sql.html "Doug Eller"... -
Ray at #2
Re: Passing "%" wild card to stored procedure
sSQL = "select whatever from whereever where something like '%something%'"
What is your code/query/result of Response.Write YourQuery?
Ray at work
"john Smith" <smith@fakedomain.com> wrote in message
news:%23F%23DYygAEHA.2308@tk2msftngp13.phx.gbl...the> Hi everyone,
>
> This may be a simple question: When I pass "%" (without the quotes) in an
> asp page to a stored procedure, I get the
>
> Incorrect syntax near '%'.
>
> message. I get the same message from the query analyzer, if I dont use> single quotes. I cannot encase the % sign in single quotes or even double
> quotes in the asp page. Is there a way around this?
>
> Thanks for your help,
> John
>
>
Ray at Guest
-
McKirahan #3
Re: Passing "%" wild card to stored procedure
"john Smith" <smith@fakedomain.com> wrote in message
news:#F#DYygAEHA.2308@tk2msftngp13.phx.gbl...the> Hi everyone,
>
> This may be a simple question: When I pass "%" (without the quotes) in an
> asp page to a stored procedure, I get the
>
> Incorrect syntax near '%'.
>
> message. I get the same message from the query analyzer, if I dont use> single quotes. I cannot encase the % sign in single quotes or even double
> quotes in the asp page. Is there a way around this?
>
> Thanks for your help,
> John
Perhaps you could use Chr(37).
McKirahan Guest
-
john Smith #4
Re: Passing "%" wild card to stored procedure
My SP is:
create proc AdvEmailReport
@custno varchar(6),
@indexno varchar (5),
@issueno varchar (5)
as
select pubname +' ' + p.issue as pubname, a.custno, custname, i.issueno,
indexno, count(*) as RespThisIssue,
(select count(*) from index_readers i join readers_all r on i.readerno =
r.readerno
where reportdate = (select max(reportdate) from readers_all) and
i.custno like @custno and i.issueno like @issueno
and i.indexno like @indexno)
as [TotalRespThisPeriod]
It works fine when I query like so in the query analyser:
exec AdvEmailReport 'cazgov', '%', 1025
John
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:eNFkh2gAEHA.640@TK2MSFTNGP09.phx.gbl...an> sSQL = "select whatever from whereever where something like '%something%'"
>
> What is your code/query/result of Response.Write YourQuery?
>
> Ray at work
>
> "john Smith" <smith@fakedomain.com> wrote in message
> news:%23F%23DYygAEHA.2308@tk2msftngp13.phx.gbl...> > Hi everyone,
> >
> > This may be a simple question: When I pass "%" (without the quotes) indouble> the> > asp page to a stored procedure, I get the
> >
> > Incorrect syntax near '%'.
> >
> > message. I get the same message from the query analyzer, if I dont use> > single quotes. I cannot encase the % sign in single quotes or even>> > quotes in the asp page. Is there a way around this?
> >
> > Thanks for your help,
> > John
> >
> >
>
john Smith Guest
-
Bob Barrows [MVP] #5
Re: Passing "%" wild card to stored procedure
john Smith wrote:
Well, you did not show us the line of code causing your problem, but here is> My SP is:
>
>
> create proc AdvEmailReport
> @custno varchar(6),
> @indexno varchar (5),
> @issueno varchar (5)
>
> It works fine when I query like so in the query analyser:
>
> exec AdvEmailReport 'cazgov', '%', 1025
>
how I would run this stored procedure:
'create and open your connection, cn, then
set rs=createobject("adodb.recordset")
cn.AdvEmailReport 'cazgov', '%', 1025, rs
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest



Reply With Quote

