我觉得我很慢,我有一个疑问:
SELECT K.RANK, physicalName, DocText, FileType
FROM Documents AS Docs
INNER JOIN CONTAINSTABLE(
Documents,DocText, 'ISABOUT (pages Weight(0.7))'
) AS K
ON Docs.DocumentID = K.[KEY]
ORDER BY K.RANK;
它在 MSSQL 中工作,如果我这样做,中继器就会被填满:
SqlCommand objCommand = new SqlCommand("SELECT K.RANK, physicalName, DocText, FileType FROM Documents AS Docs INNER JOIN CONTAINSTABLE(Documents,DocText, 'ISABOUT ( pages Weight(0.7) )') AS K ON Docs.DocumentID = K.[KEY] ORDER BY K.RANK", objConn);
但是当我尝试用参数替换搜索文本时,它没有给我任何结果:
SqlCommand objCommand = new SqlCommand("SELECT K.RANK, physicalName, DocText, FileType FROM Documents AS Docs INNER JOIN CONTAINSTABLE(Documents,DocText, 'ISABOUT ( @SearchParams )') AS K ON Docs.DocumentID = K.[KEY] ORDER BY K.RANK", objConn);
objCommand.Parameters.AddWithValue("@SearchParams", "pages Weight(0.7)");
我究竟做错了什么?