SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Stored Procedure
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

suarezst1984
Starting Member

USA
16 Posts

Posted - 02/02/2009 :  17:01:10  Show Profile  Click to see suarezst1984's MSN Messenger address  Reply with Quote
Could someone help me to understand what the following sql query is saying. This is basically a stored procedure but I need to understand what this says or is anyway to actually put this in a simpler query? term1 and term2 are basically the number of parameters for a search. If I search in a website for white paint (white would be param1 and paint would be param2).
Thanks for any help

--SET @searchString = 'SELECT sfProducts.prodID, sfProducts.prodName, sfProducts.prodImageSmallPath, sfProducts.prodLink, sfProducts.prodPrice, sfProducts.prodSaleIsActive, sfProducts.prodSalePrice, sfProducts.ProdID, sfProducts.prodDescription, sfProducts.prodAttrNum, sfProducts.prodCategoryId, sfProducts.prodShortDescription '
SELECT @searchString = @searchString + 'FROM CONTAINSTABLE(prodSearchTemp, *, ' + char(39) + 'FORMSOF(INFLECTIONAL, ' + @term1 + ', ' + @term2 + ')' + char(39) + ') S '
SELECT @searchString = @searchString + 'INNER JOIN sfProducts ON S.[KEY] = sfProducts.prodID INNER JOIN prodSearchTemp ON S.[KEY] = prodSearchTemp.prodID '
SELECT @searchString = @searchString + 'LEFT JOIN sfcompatString ON sfProducts.prodID = sfCompatString.compatStringProdID '
SELECT @searchString = @searchString + 'INNER JOIN sfManufacturers ON sfProducts.prodManufacturerID = sfManufacturers.mfgID '
SELECT @searchString = @searchString + 'WHERE (FREETEXT(prodSearchTemp.*, ' + char(39) + @term1 + char(39) + ') '
SELECT @searchString = @searchString + @andOr + ' FREETEXT(prodSearchTemp.*, ' + char(39) + @term2 + char(39) + ')) '

END
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000