Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

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

Starting Member

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) + ')) '

  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000