Try:
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
P
-----Original Message-----
From: Top-Link Tech (John Ceci) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 26, 2000 3:36 PM
To: CF-Talk
Subject: SQL Stored Procedure Question...
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.
------------------------------------------------------------------------------
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.