I'd like the basic search to look also in the Product Description,
so i'm modifying the aspdnsf_GetProducts this way:
Code:
if exists (select * from [dbo].sysobjects where id = OBJECT_ID(N'[dbo].[aspdnsf_GetProducts]') and OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[aspdnsf_GetProducts]
GO
create proc [dbo].[aspdnsf_GetProducts]
@categoryID int = null,
@sectionID int = null,
@manufacturerID int = null,
@distributorID int = null,
@genreID int = null,
@vectorID int = null,
@localeID int = null,
@CustomerLevelID int = null,
@affiliateID int = null,
@ProductTypeID int = null,
@ViewType bit = 1, -- 0 = all variants, 1 = one variant
@sortEntity int = 0, -- 1 = category, 2 = section, 3 = manufacturer, 4 = distributor, 5= genre, 6 = vector
@pagenum int = 1,
@pagesize int = null,
@StatsFirst tinyint = 1,
@searchstr nvarchar(4000) = null,
@extSearch tinyint = 1,
so the next line will be true
Code:
or (patindex(@searchstr, isnull(p.Description, '')) > 0 and @extSearch = 1)
is this the right way?
thanks