sql server full text search:
I have a SP that has the following 'where' statement '@sFamilyName is null or contains (HCU.FamilyName, @sFamilyName)' Everything works fine, until I do massive row inserts on the table, and when using that SP I get the following error: Server: Msg 7603, Level 15, State 1, Procedure SearchHCUs, Line 27 Syntax error in search condition, or empty or null search condition ''. If I delete most of the rows inserted, everything goes back to normal. The table has 'change tracking' and 'update index in background' This is the info about the SQl version: Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4) any hint, clue, possible cause or solution will be
Pablo, Is the @sFamilyName variable truly NULL? If so, in your stored proc SearchHCUs, you may need to test for NULLs in @sFamilyName using ISNULL and trap for a NULL condition when you issue the actual T-SQL statement as a valid non-NULL search_word must be supplied. It *might* also be possible that when you are doing a "massive row inserts" and a user is querying against this FT-enabled table with 'change tracking' and 'update index in background' enabled, that they are searching for a search_word that has not yet been FT-Indexed and pushed to the FT Catalog? Regards, John [quoted text, click to view] "Pablo garcia" <pablo.garcia@simpl.co.nz> wrote in message news:476901c3b20c$482398f0$a601280a@phx.gbl... > I have a SP that has the following 'where' > statement '@sFamilyName is null or contains > (HCU.FamilyName, @sFamilyName)' > > Everything works fine, until I do massive row inserts on > the table, and when using that SP I get the following > error: > > Server: Msg 7603, Level 15, State 1, Procedure SearchHCUs, > Line 27 > Syntax error in search condition, or empty or null search > condition ''. > > If I delete most of the rows inserted, everything goes > back to normal. > > The table has 'change tracking' and 'update index in > background' > > This is the info about the SQl version: > Microsoft SQL Server 2000 - 8.00.760 (Intel X86) > Dec 17 2002 14:22:05 > Copyright (c) 1988-2003 Microsoft Corporation > Enterprise Edition on Windows NT 5.0 (Build 2195: > Service Pack 4) > > any hint, clue, possible cause or solution will be > extremely appreciated.
YES, it is null but, shouldn't it pick the '@sFamilyName is null' part of the clause? The thing is that searching with @sFamilyName works for some time, and then ... after inserting lots of rows it starts failing. My suspicion is that it has something to do with the number of rows for that table. It starts failing in diferent DBs (aka testing, dev, etc) when we reach certain amount of rows. thnx for your reply. [quoted text, click to view] >-----Original Message----- >Pablo, >Is the @sFamilyName variable truly NULL? If so, in your stored proc >SearchHCUs, you may need to test for NULLs in @sFamilyName using ISNULL and >trap for a NULL condition when you issue the actual T-SQL statement as a >valid non-NULL search_word must be supplied. > >It *might* also be possible that when you are doing a "massive row inserts" >and a user is querying against this FT-enabled table with 'change tracking' >and 'update index in background' enabled, that they are searching for a >search_word that has not yet been FT-Indexed and pushed to the FT Catalog? > >Regards, >John > > > >"Pablo garcia" <pablo.garcia@simpl.co.nz> wrote in message >news:476901c3b20c$482398f0$a601280a@phx.gbl... >> I have a SP that has the following 'where' >> statement '@sFamilyName is null or contains >> (HCU.FamilyName, @sFamilyName)' >> >> Everything works fine, until I do massive row inserts on >> the table, and when using that SP I get the following >> error: >> >> Server: Msg 7603, Level 15, State 1, Procedure SearchHCUs, >> Line 27 >> Syntax error in search condition, or empty or null search >> condition ''. >> >> If I delete most of the rows inserted, everything goes >> back to normal. >> >> The table has 'change tracking' and 'update index in >> background' >> >> This is the info about the SQl version: >> Microsoft SQL Server 2000 - 8.00.760 (Intel X86) >> Dec 17 2002 14:22:05 >> Copyright (c) 1988-2003 Microsoft Corporation >> Enterprise Edition on Windows NT 5.0 (Build 2195: >> Service Pack 4) >> >> any hint, clue, possible cause or solution will be >> extremely appreciated. > > >.
Pablo, If it NULL, you should add some code to prevent the execution of the SQL FTS query. The error Msg text -"Syntax error in search condition, or empty or null search condition " - is generic and covers errors in the search condition that can also include syntax errors as well as empty or null search conditions. Whether or not, your query works some of the time or not, you still should trap for a NULL search condition and not execute the query if that occurs. If you add the check for NULL, does the query continue to fail when the number of rows reaches a certain number? Regards, John [quoted text, click to view] "Pablo Garcia" <pablo.garcia@simpl.co.nz> wrote in message news:028701c3b21a$cad38720$a301280a@phx.gbl... > YES, it is null but, shouldn't it pick the '@sFamilyName > is null' part of the clause? > The thing is that searching with @sFamilyName works for > some time, and then ... after inserting lots of rows it > starts failing. > > My suspicion is that it has something to do with the > number of rows for that table. It starts failing in > diferent DBs (aka testing, dev, etc) when we reach certain > amount of rows. > > thnx for your reply. > >-----Original Message----- > >Pablo, > >Is the @sFamilyName variable truly NULL? If so, in your > stored proc > >SearchHCUs, you may need to test for NULLs in > @sFamilyName using ISNULL and > >trap for a NULL condition when you issue the actual T-SQL > statement as a > >valid non-NULL search_word must be supplied. > > > >It *might* also be possible that when you are doing > a "massive row inserts" > >and a user is querying against this FT-enabled table > with 'change tracking' > >and 'update index in background' enabled, that they are > searching for a > >search_word that has not yet been FT-Indexed and pushed > to the FT Catalog? > > > >Regards, > >John > > > > > > > >"Pablo garcia" <pablo.garcia@simpl.co.nz> wrote in message > >news:476901c3b20c$482398f0$a601280a@phx.gbl... > >> I have a SP that has the following 'where' > >> statement '@sFamilyName is null or contains > >> (HCU.FamilyName, @sFamilyName)' > >> > >> Everything works fine, until I do massive row inserts on > >> the table, and when using that SP I get the following > >> error: > >> > >> Server: Msg 7603, Level 15, State 1, Procedure > SearchHCUs, > >> Line 27 > >> Syntax error in search condition, or empty or null > search > >> condition ''. > >> > >> If I delete most of the rows inserted, everything goes > >> back to normal. > >> > >> The table has 'change tracking' and 'update index in > >> background' > >> > >> This is the info about the SQl version: > >> Microsoft SQL Server 2000 - 8.00.760 (Intel X86) > >> Dec 17 2002 14:22:05 > >> Copyright (c) 1988-2003 Microsoft Corporation > >> Enterprise Edition on Windows NT 5.0 (Build 2195: > >> Service Pack 4) > >> > >> any hint, clue, possible cause or solution will be > >> extremely appreciated. > > > > > >. > >
thnx for the help. I ended up modifying the SP, thing that I wanted to avoid. Now everything seems to be working. [quoted text, click to view] >-----Original Message----- >Pablo, >If it NULL, you should add some code to prevent the execution of the SQL FTS >query. The error Msg text -"Syntax error in search condition, or empty or >null search condition " - is generic and covers errors in the search >condition that can also include syntax errors as well as empty or null >search conditions. Whether or not, your query works some of the time or >not, you still should trap for a NULL search condition and not execute the >query if that occurs. > >If you add the check for NULL, does the query continue to fail when the >number of rows reaches a certain number? > >Regards, >John > >"Pablo Garcia" <pablo.garcia@simpl.co.nz> wrote in message >news:028701c3b21a$cad38720$a301280a@phx.gbl... >> YES, it is null but, shouldn't it pick the '@sFamilyName >> is null' part of the clause? >> The thing is that searching with @sFamilyName works for >> some time, and then ... after inserting lots of rows it >> starts failing. >> >> My suspicion is that it has something to do with the >> number of rows for that table. It starts failing in >> diferent DBs (aka testing, dev, etc) when we reach certain >> amount of rows. >> >> thnx for your reply. >> >-----Original Message----- >> >Pablo, >> >Is the @sFamilyName variable truly NULL? If so, in your >> stored proc >> >SearchHCUs, you may need to test for NULLs in >> @sFamilyName using ISNULL and >> >trap for a NULL condition when you issue the actual T- SQL >> statement as a >> >valid non-NULL search_word must be supplied. >> > >> >It *might* also be possible that when you are doing >> a "massive row inserts" >> >and a user is querying against this FT-enabled table >> with 'change tracking' >> >and 'update index in background' enabled, that they are >> searching for a >> >search_word that has not yet been FT-Indexed and pushed >> to the FT Catalog? >> > >> >Regards, >> >John >> > >> > >> > >> >"Pablo garcia" <pablo.garcia@simpl.co.nz> wrote in message >> >news:476901c3b20c$482398f0$a601280a@phx.gbl... >> >> I have a SP that has the following 'where' >> >> statement '@sFamilyName is null or contains >> >> (HCU.FamilyName, @sFamilyName)' >> >> >> >> Everything works fine, until I do massive row inserts on >> >> the table, and when using that SP I get the following >> >> error: >> >> >> >> Server: Msg 7603, Level 15, State 1, Procedure >> SearchHCUs, >> >> Line 27 >> >> Syntax error in search condition, or empty or null >> search >> >> condition ''. >> >> >> >> If I delete most of the rows inserted, everything goes >> >> back to normal. >> >> >> >> The table has 'change tracking' and 'update index in >> >> background' >> >> >> >> This is the info about the SQl version: >> >> Microsoft SQL Server 2000 - 8.00.760 (Intel X86) >> >> Dec 17 2002 14:22:05 >> >> Copyright (c) 1988-2003 Microsoft Corporation >> >> Enterprise Edition on Windows NT 5.0 (Build 2195: >> >> Service Pack 4) >> >> >> >> any hint, clue, possible cause or solution will be >> >> extremely appreciated. >> > >> > >> >. >> > > > >.
Don't see what you're looking for? Try a search.
|