title: Full Text Search with blank spaces in SQL Server 2008
body: <p>There is a problem occurs when I search data using full-text search with SQL Server 2008.</p>
  
  <p>When I search data with no blank space it works but when I enter data with blank spaces it gives an error.</p>
  
  <p>Like if I search <code>'amit'</code> it works but if data is <code>'amit is working'</code> it gives error.</p>
  
  <p>I am using ASP.NET MVC 4.0 with SQL Server 2008.</p>
  
  <p>Thanks Amit.</p>
  
  <pre><code>Create PROC [usp_Feedback_Search]
  @Word nvarchar(500) ,   
  @CompanyId UNIQUEIDENTIFIER     
  
  As
  IF ISNULL(@Word,'') = ''
   BEGIN
   Select          
    [Id] ,
  [Content] ,    
  [UserId],    
   [VoteCount] ,
   [IsOpen],
   [Deleted],
   [RowVersion],    
   [CreatedBy],     
   [CreatedOn],    
   [UpdatedOn],    
   [UpdatedBy],       
   [CompanyId], 
   [DisplayId],
    [Status]
   FROM Feedback         
    WHERE CompanyId=@CompanyId
    END
   ELSE
    BEGIN   
  
  DECLARE @formatedWord varchar(500)='"'+@word+'\+"'
  
    Select          
    [Id] ,
  [Content] ,    
  [UserId],    
   [VoteCount],
   [IsOpen],
   [Deleted],
   [RowVersion],    
   [CreatedBy],     
   [CreatedOn],    
   [UpdatedOn],    
   [UpdatedBy],       
   [CompanyId], 
   [DisplayId],
    [Status]    
    FROM Feedback            
    Where CONTAINS(*,@Word)     
    and CompanyId=@CompanyId
    END
   GO
  </code></pre>