January 9, 2008 at 9:12 am
This simple stored procedure works FINE!
ALTER PROCEDURE [dbo].[UB_BH_ANNEX_SP]
@SitusParam NCHAR(40)
AS
BEGIN
SET NOCOUNT ON;
SELECT Situs, Compute_URL, RC FROM UB_BH_ANNEX WHERE (Situs LIKE '12%' )
END
When I throw in the parameter SitusParam with the %'s it returns NO rows.
SELECT Situs, Compute_URL, RC FROM UB_BH_ANNEX WHERE (Situs LIKE '%' + @SitusParam + '%' )
This should be simple... I've tried every permutation of the %'s and quotes I can think of, except I suppose for the one that's right.
January 9, 2008 at 9:19 am
Try changing that to a varchar so that you don't get the etc blank spaces....
@SitusParam VARCHAR(40)
if you called your code as it is now it queries for
...
WHERE (SITUS like '%12 %')
...
Go NVARCHAR if you need unicode.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
January 9, 2008 at 9:22 am
Change NCHAR to VARCHAR
works for me 🙂
Edit: Beaten to it!!
January 9, 2008 at 9:25 am
Doh, love the simple fixes, thank you so much!!!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply