Wednesday, March 7, 2012

Freetext search not working after SQL 2005 upgrade

*** See next post as I have found it is nothing to do with freetext search I just assumed it was this ***

Hi

I have upgraded our test system to SQL 2005 from 2000 and restored a production database.

I have rebuilt the freetext index and it would seem that if you query this from an .ASP page using OLEDB it does not return any results even though there are some. If you then run the same query in Management studio you do get the expected results. The code worked perfectly under SQL 2000. Also all other queries that run from the .ASP page work correctly that do not involve a freetext seach.

I have made sure the client is using the lastest MDAC pack 2.8 sp1

The query is

SELECT title
FROM catalog
WHERE CONTAINS(title, 'green*')

Connection string in .ASP page

Provider=SQLOLEDB;Data Source=192.168.0.5;Initial Catalog=DVD;User Id=XXXXXX;Password=XXXXXX;

Thanks in Advance

MatRight after more digging I have found out it is NOT the freetext seach at all. I simplified the query above and removed a left join when I posted the question as I thought it could not be this.

I have now just created two simple tables in my database
linkme
linkme2

both of which have one column called [catalog-no]

I have put one record in linkme

select * from linkme -- pulls back one record correctly via .asp and management studio
select * from linkme left join linkme2 on linkme.[catalog-no] = linkme2.[catalog-no] -- pulls back one record in management studio and 0 records in .asp connection !!!

HELP|||Just to make sure I was not going mad I have created the same two table in SQL 2000 and pointed the .asp script to this and sure enough i get 1 record ?

No comments:

Post a Comment