Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sp_wiz
Yak Posting Veteran
55 Posts |
Posted - 2001-10-20 : 10:11:09
|
HiI seem to be hitting a brick wall with this. I am tying to write a sp that will allow me to search in numerous combinations.Here's the code so fardeclare @Photographer nchar(15)declare @keywords nchar(255)declare @photocategory nchar(15)set @photosubcategory = nullset @photographer = nullset @photocategory = nullset @keywords = 'plant'SELECT photos.trans_no, PicDesc, PHM_Name FROM PhotoGS_Main,photos,Picdesc WHERE photos.trans_no = PicDesc.trans_no AND PhotoGS_Main.Photog_ID = Photos.PH_Code AND Photos.sub_code IN (Select sub_code from subject where text1 = COALESCE(@photocategory,text1)) AND Photos.Sub_code = COALESCE(@photosubcategory,Sub_code) AND Photos.PH_code = COALESCE(@Photographer, Photos.PH_code)AND Photos.sub_code IN (Select sub_code from subject where text1 like '%'+@keywords+'%')Everything works fine until i try to search using keywords, the other options are all from dropdown boxes on a page. Can some one suggest where i am going wrong, or suggest an alternative..Cheers Robp |
|
|
|
|