Stored procedure for full text search
Hi,
I've the FTS in a stored procedure and i am calling the
stored procedure from ASP program. Here is the stored
procedure :
-- =============================================
-- Create procedure basic template
-- =============================================
-- creating the store procedure
CREATE PROC dbo.spWebSearch
(
@PriceID int,
@SearchTxt nvarchar(100),
@StoreID char(2)
)
AS
-- Code for Beavercreek
if @StoreID = 'BC'
Begin
select S.[KEY], S.RANK, PQ.ProductName,
PQ.Description, P.UnitPrice, PQ.ProductID, P.UnitPrice *
100 as list_price FROM (Products AS P INNER JOIN
Product_Quantity AS PQ ON P.ProductID=PQ.ProductID) INNER
JOIN ContainsTable(Product_Quantity,*,@SearchTxt) AS S ON
PQ.ProductID = S.[KEY] Order by S.Rank Desc;
End
GO
This is how i am calling it from the ASP page
PriceID = 1
StoreID = "BC"
str = "floppy"
spStr = "exec spWebSearch " & PriceID & "," & "'" &
newstring & "'" & "," & "'" & StoreID & "'"
rsProducts.Open spStr, MSCS ' Here MSCS is the connection
string.
I get the following error :
Microsoft OLE DB Provider for ODBC Drivers
error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]A variable
cannot be used to specify a search condition in a fulltext
predicate when accessed through a cursor.
/result.asp, line 173
Can't we pass the search criteria as a variable to a FTS
stored procedure? Also please note that i am using
clientside recordset cursor. If i execute the same stored
procedure from query ****yzer it works great. Any help is
appreciated.
TIA
Sajid
|