Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Contains Operator


Contains Operator

Author
Message
sahar.ghassami
sahar.ghassami
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 19
Hello
I Write a query which use 'Contains' operator in it . when I execute this query in sql server 2005
the run time is very fast but when I execute in sql server 2008 R2 it took 16 seconds . I rebuild my
fulltext and alter all indexes in each table but did not work . Can anybody help me?
This is my query:
/*****
SELECT Distinct document.DocNo,document.DocType,Title.Title,Header.WriterName+' '+Header.WriterFamily+' '+Header.Conf+' '+Header.Tanalgan
AS Padid1 ,Publisher.PublisherName+' '+Publisher.PublishedPlace+' '+Publisher.PublishedDate
As T,Rade.MainRange+'،'+Rade.Num+'،'+Rade.KaterNo+'،'+Rade.Date1 As Rade
--,ROW_NUMBER() OVER(Order By Save1.SaveCode) AS RowNumber
FROM Document Left Outer JOIN
Description1 ON document.DocNo = Description1.DocNo Left Outer JOIN
Padid ON document.DocNo = Padid.DocNO Left Outer JOIN
Publisher ON document.DocNo = Publisher.DocNo Left Outer JOIN
rade ON document.DocNo = rade.DocNO Left Outer JOIN
Subjects ON document.DocNo = Subjects.DocNo Left Outer JOIN
Title ON document.DocNo = Title.DocNO Left Outer JOIN
Header ON document.DocNo = Header.DocNo,Save1
Where [Document].DocNo<>'0'
And [Document].DocNo=Save1.DocNo
And [Document].DocType=Save1.DocType

And document.DocType='Book'
AND (Save1.DocStatus = 'Shelf')
And( (CONTAINS(Title.Title , '"abc"')
OR CONTAINS( Header.WriterName , '"abc"')
OR CONTAINS( Header.WriterFamily , '"abc"')
OR CONTAINS(Publisher.PublisherName , '"abc"')
OR CONTAINS(Publisher.PublishedPlace , '"abc"')
OR CONTAINS(Publisher.PublishedDate , '"abc"')
OR CONTAINS(Description1.ISBN , '"abc"')
OR CONTAINS(Title.Farvast , '"abc"')
OR CONTAINS(Header.Tanalgan , '"abc"')
)
)
AND Rade.Type='LC'
****/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search