S
savvy
I searching using Keywords in MS Word and pdf documents for which i
have used the Index Server and linked with SQL Server but when i am
running the stored procedure thro my webpage i'm getting these errors.
And when i run this code in Query Analyzer its giving expeceted
results. I dont know where the problem is can anyone help please . I'm
really badly stuck. Thanks in Advacne
User does not have permission to perform this action. Line 3: Incorrect
syntax near '@searchstring'. Invalid object name 'FileSearchResults'.
And my stored procedure is given below
CREATE PROCEDURE SelectIndexServerCVpaths
(
@searchstring varchar(100)
)
AS
Exec sp_addlinkedserver FileSystem,
'Index Server',
'MSIDXS',
'Web',
'c:\inetpub\wwwroot\sap-resources\Uploads'
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_NAME = 'FileSearchResults')
DROP VIEW FileSearchResults
EXEC ('CREATE VIEW FileSearchResults AS SELECT * FROM
OPENQUERY(FileSystem,''SELECT Directory, FileName,
DocAuthor, Size, Create, Write, Path FROM
SCOPE() WHERE FREETEXT(''@searchstring'')'')')
SELECT * FROM FileSearchResults F, CVdetails C WHERE C.CV_Path = F.PATH
AND C.DefaultID=1
GO
have used the Index Server and linked with SQL Server but when i am
running the stored procedure thro my webpage i'm getting these errors.
And when i run this code in Query Analyzer its giving expeceted
results. I dont know where the problem is can anyone help please . I'm
really badly stuck. Thanks in Advacne
User does not have permission to perform this action. Line 3: Incorrect
syntax near '@searchstring'. Invalid object name 'FileSearchResults'.
And my stored procedure is given below
CREATE PROCEDURE SelectIndexServerCVpaths
(
@searchstring varchar(100)
)
AS
Exec sp_addlinkedserver FileSystem,
'Index Server',
'MSIDXS',
'Web',
'c:\inetpub\wwwroot\sap-resources\Uploads'
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_NAME = 'FileSearchResults')
DROP VIEW FileSearchResults
EXEC ('CREATE VIEW FileSearchResults AS SELECT * FROM
OPENQUERY(FileSystem,''SELECT Directory, FileName,
DocAuthor, Size, Create, Write, Path FROM
SCOPE() WHERE FREETEXT(''@searchstring'')'')')
SELECT * FROM FileSearchResults F, CVdetails C WHERE C.CV_Path = F.PATH
AND C.DefaultID=1
GO