I found the answer to this today when converting my own database from SQL 2005 to SQL 2008.
Pass ""
for your search term and change the @search_term = ''
test to be @search_term = '""'
SQL server will ignore the double quotes and not throw an error.
For example, the following would actually returns all records in the Users table:
declare @SearchTerm nvarchar(250)
SET @SearchTerm = '""'
select UserId, U.Description, U.UserName
from dbo.Users U
WHERE ((@SearchTerm = '""') OR CONTAINS( (U.Description, U.UserName), @SearchTerm))
If you are using .Net, you might grab a copy of E. W. Bachtal's FullTextSearch class. His site is very informative: http://ewbi.blogs.com/develops/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…