Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Dejan
Starting Member
14 Posts |
Posted - 2009-01-03 : 12:25:49
|
| I'm using this procedure to seach in my database:----------------------ALTER PROCEDURE [dbo].[Search] @search nvarchar (250)asSELECT *FROM textWHERE CONTAINS (*, @search);------------------------When I try to search for only one word I receive results, but when I try to search for 2 or more words, I get error:----------------------Msg 7630, Level 15, State 3, Procedure Search, Line 4Syntax error near 'word' in the full-text search condition 'Word word'.----------------------If I put + between the word I get results. How to modify stored procedure to get results for more then one word? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-03 : 13:54:29
|
try like this and see if it worksALTER PROCEDURE [dbo].[Search] @search nvarchar (250)asSELECT *FROM textWHERE CONTAINS (*, REPLACE(@search,' ','+'); |
 |
|
|
Dejan
Starting Member
14 Posts |
Posted - 2009-01-03 : 14:03:56
|
| Incorrect syntax near 'REPLACE'. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-03 : 14:06:32
|
quote: Originally posted by Dejan Incorrect syntax near 'REPLACE'.
i missed a bracesALTER PROCEDURE [dbo].[Search] @search nvarchar (250)asSELECT *FROM textWHERE CONTAINS (*, REPLACE(@search,' ','+')); |
 |
|
|
Dejan
Starting Member
14 Posts |
Posted - 2009-01-03 : 14:24:53
|
| Same... |
 |
|
|
Dejan
Starting Member
14 Posts |
Posted - 2009-01-03 : 14:46:57
|
| I'll use it this one TextBox1.Text.Replace(" ", "+") it's work |
 |
|
|
|
|
|
|
|