When I pass @param1 with space separated values, like N'here it is', there is a syntax error. If no spaces in the middle, for example N'hereitis', there is no such syntax error. Any ideas what is wrong?
I call stored procedure in this way,
EXEC @return_value = [dbo].[foo]
  @param1 = N'here it is',
  @param2 = 10,
  @param3 = 10
Error message is
message 7630, level 15, status 3, there is syntax error near 'here it is'.
 SELECT * 
 FROM (
         SELECT count(*) over() AS [Count],
                 *, ROW_NUMBER() OVER (order by t.indexfoo ASC ) AS rowNum 
         FROM   dbo.tablefoo t        
         WHERE  contains(t.col1,@param1) 
         OR     contains(t.col2,@param1) 
         OR     contains(t.col3,@param1)
      ) tt 
 WHERE  tt.rowNum between @param2 and  @param3 + @param2-1 
How can this be fixed?
 
     
     
    