Hi all!

I have a simple procedure which should return an 'id' field if parameter is passed.
The problem is that if I provide the single letter parameter it returns no records although there are matches. But if i provide the whole word as it's written in a table, I get records returned.

the code:

USE [database]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[filter_opombe] 
(   

@opombe_par nchar(256)

)

AS
BEGIN
(

SELECT        Id_opombe
FROM            opombe
WHERE        (CHARINDEX(@opomba_par, opomba,0) > 0)
)
END

Many thanks in advance!

Member Avatar for diafol

Please update tags to include specific DB system

still searching for EDIT button...

anyways - SQL SERVER

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.