This is a multi-part message in MIME format.
--------------B9336A7DD898E0D1B5936117
Content-Type: multipart/alternative;
 boundary="------------778FA7AB3A393FFA7903E735"


--------------778FA7AB3A393FFA7903E735
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; 
x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit

I guess this has probably been answeres by now.... but just in case...

try adding the % to the variable before doing the LIKE.... i.e.   SELECT @alpha = 
@alpha + '%'

Nick




"Top-Link Tech (John Ceci)" wrote:

> Hey All,
>
> Got a quick one for all of you...
>
> I am implementing a stored procedure and I cant seem to get a LIKE clause to
> work with a variable passed in:
>
> SHORT VERSION OF CODE:
> =========================
>
> CREATE PROCEDURE GetContacts @alpha varchar(1)  AS
>
> SELECT Contacts_Main.company
> FROM Contacts_Main
> WHERE (Contacts_Main.company LIKE '@alpha%')
> ORDER BY Contacts_Main.company
>
> ===========================
>
> When I turn on execution plan I see that the variable was never escaped to
> its value...now I assume this is because the variable is inside of ' '
> marks, what would the syntax for this look like?
>
> Thanks in advance!
> John
>
> |=======================================|
> |John Ceci                              |
> |Director of Application Architecture   |
> |[EMAIL PROTECTED]               |
> |TopLink Technologies                   |
> |http://www.tltechnologies.com          |
> |=======================================|
>
> ------------------------------------------------------------------------------
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit 
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
>message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

--------------778FA7AB3A393FFA7903E735
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I guess this has probably been answeres by now.... but just in case...
<p>try adding the % to the variable before doing the LIKE.... i.e.&nbsp;&nbsp;
SELECT @alpha = @alpha + '%'
<p>Nick
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;
<p>"Top-Link Tech (John Ceci)" wrote:
<blockquote TYPE=CITE>Hey All,
<p>Got a quick one for all of you...
<p>I am implementing a stored procedure and I cant seem to get a LIKE clause
to
<br>work with a variable passed in:
<p>SHORT VERSION OF CODE:
<br>=========================
<p>CREATE PROCEDURE GetContacts @alpha varchar(1)&nbsp; AS
<p>SELECT Contacts_Main.company
<br>FROM Contacts_Main
<br>WHERE (Contacts_Main.company LIKE '@alpha%')
<br>ORDER BY Contacts_Main.company
<p>===========================
<p>When I turn on execution plan I see that the variable was never escaped
to
<br>its value...now I assume this is because the variable is inside of
' '
<br>marks, what would the syntax for this look like?
<p>Thanks in advance!
<br>John
<p>|=======================================|
<br>|John 
Ceci&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|
<br>|Director of Application Architecture&nbsp;&nbsp; |
<br>|[EMAIL PROTECTED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|
<br>|TopLink 
Technologies&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|
<br>|<a 
href="http://www.tltechnologies.com">http://www.tltechnologies.com</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|
<br>|=======================================|
<p>------------------------------------------------------------------------------
<br>Archives: <a 
href="http://www.mail-archive.com/cf-talk@houseoffusion.com/">http://www.mail-archive.com/cf-talk@houseoffusion.com/</a>
<br>To Unsubscribe visit <a 
href="http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk">http://www.houseoffusion.com/index.cfm?sidebar=lists&amp;body=lists/cf_talk</a>
or send a message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.</blockquote>
</html>

--------------778FA7AB3A393FFA7903E735--

--------------B9336A7DD898E0D1B5936117
Content-Type: text/x-vcard; charset=us-ascii;
 name="nickslay.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Nick Slay
Content-Disposition: attachment;
 filename="nickslay.vcf"

begin:vcard 
n:Slay;Nick
tel;cell:0414 810284
tel;home:02 4381 0284
tel;work:02 4381 0284
x-mozilla-html:FALSE
url:http://www.webbods.com.au
org:Webbods Pty Ltd
adr:;;PO Box 4054;Copacabana;NSW;2251;Australia
version:2.1
email;internet:[EMAIL PROTECTED]
title:Technical Director
x-mozilla-cpt:;3
fn:Nick Slay
end:vcard

--------------B9336A7DD898E0D1B5936117--

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to