I'm confused about how to use WITH (NOLOCK)
along with full-text search.
From SQL Server NOLOCK and joins I got an important information that we should use WITH (NOLOCK)
in each table in a SQL join. However, it doesn't work with this query:
SELECT *
FROM myTable AS FT_TBL WITH (NOLOCK)
FULL OUTER JOIN
FREETEXTTABLE (myTable, fieldName, 'SRI') AS KEY_TBL WITH (NOLOCK)
ON FT_TBL.id = KEY_TBL.[KEY]
The error message is:
Msg 156, Level 15, State 1, Line 7
Incorrect syntax near the keyword 'WITH'.
Msg 319, Level 15, State 1, Line 7
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.'
The problem is in the 'AS KEY_TBL WITH (NOLOCK)', because it works without the 'WITH (NOLOCK)' on it. What should I do? I want that every similar record appears in the search result although somebody else updating those records. Please help and thanks in advance.