Problem with comparing a Table View Column with the Table Column?

S

savvy

I have a CVdetails table which all the personal and technical details
along with the path called CV_Path which stores the path of CV word
doc. Using Index Server Query i got the paths in my SQL server using
Linked Server. I used this Query

SELECT Path FROM OPENQUERY (FileSystem,'SELECT Directory, FileName,
DocAuthor, Size, Create, Write, Path FROM SCOPE (''
"c:\myCatalogFolder" '') WHERE FREETEXT (''reference'')')

Which gave a result:
Path
c:\mycatalogfolder\ajaxguide.doc
c:\mycatalogfolder\quickguide.txt

Now, I want to compare these paths with the ones in the CVdetails
table which are same and drag out the relevant CVdetails of that
particular path. My code is shown below but its not working out, its
not giving any results though the paths are same. I hope I made some
sense till now

Thanks in Advance

IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_NAME = 'FileSearchResults')
DROP VIEW FileSearchResults
GO

CREATE VIEW FileSearchResults
AS
SELECT * FROM OPENQUERY (FileSystem,'SELECT Directory, FileName,
DocAuthor, Size, Create, Write, Path FROM SCOPE (''
"c:\myCatalogFolder" '') WHERE FREETEXT (''reference'')')
Go

SELECT * FROM FileSearchResults F, CVdetails C WHERE C.CV_Path = F.PATH
Go
 
S

savvy

i think i got the answer. Thanks for your time mate.
Just now i found out that though i assign the path directly as shown
below it was not selecting the particular row.
I checked be4 therefore no spaces i dont know why it was not selecting
SELECT * FROM CVdetails WHERE
CV_Path='c:\mycatalogfolder\quickguide.txt'
Then i deleted the path in that field and copied it again and suprising
it worked.
Anyway, it worked finally
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top