Showing posts with label oriented. Show all posts
Showing posts with label oriented. Show all posts

Monday, March 19, 2012

an interesting problem

I manage a news database oriented website where there is a column named
'news' in a table 'news' storing huge HTML formatted artciles. I had to
replace a particular word 'india' by 'world' in all the records under this
column. Strange thing is the occurances of the word 'india' towards the end
of the articles are getting recognized by
select count(*) from news where charindex('india',news)>0
i.e. the above query results 0. Though there are thousands of records in
the column 'news' containing the word 'india'.
I think the issue is of max limit of charindex.
Please help at the earliest convenience of yours.
Regards,
John-I think the issue is of max limit of charindex.
No I don=B4t think so, because Charindex returns an INT, so there should
be a problem if the character would be found at the
2,147,483,648 +1. So are you searching on the right table and database
? That should return a hit, if the word india is present in there.
HTH, jens Suessmeyer.|||John
Did you try LIKE operator?
"John" <netconsul@.gmail.com> wrote in message
news:ePx4t626FHA.1140@.tk2msftngp13.phx.gbl...
>I manage a news database oriented website where there is a column named
>'news' in a table 'news' storing huge HTML formatted artciles. I had to
>replace a particular word 'india' by 'world' in all the records under this
>column. Strange thing is the occurances of the word 'india' towards the end
>of the articles are getting recognized by
> select count(*) from news where charindex('india',news)>0
>
> i.e. the above query results 0. Though there are thousands of records in
> the column 'news' containing the word 'india'.
> I think the issue is of max limit of charindex.
> Please help at the earliest convenience of yours.
> Regards,
> John
>
>
>|||Thats what my problem is.
select news from news where news like '%india%'
results in 74000+ records while
select count(*) from news where charindex('india',news)>0
returns none.
I am using charindex to find the position of India in the record and use
'updatetext' to replace it by world.
because charindex('india',news) returns 0, updatetext cant replace india in
each record by world.
Any quick help will be appreciated.
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1132230042.794270.99970@.g43g2000cwa.googlegroups.com...
-I think the issue is of max limit of charindex.
No I don´t think so, because Charindex returns an INT, so there should
be a problem if the character would be found at the
2,147,483,648 +1. So are you searching on the right table and database
? That should return a hit, if the word india is present in there.
HTH, jens Suessmeyer.|||Hi Everyone,
Solution to my problem lies here.
http://www.aspfaq.com/show.asp?id=2445
Please note that my fear about charindex is correct.
Initially I used CHARINDEX, but that failed if the pattern was deeper than
8,000 characters into the value. PATINDEX never dies. :-)
Thanks
John
"John" <netconsul@.gmail.com> wrote in message
news:eT7LVE66FHA.4076@.TK2MSFTNGP10.phx.gbl...
> Thats what my problem is.
> select news from news where news like '%india%'
> results in 74000+ records while
> select count(*) from news where charindex('india',news)>0
>
> returns none.
> I am using charindex to find the position of India in the record and use
> 'updatetext' to replace it by world.
> because charindex('india',news) returns 0, updatetext cant replace india
> in each record by world.
>
> Any quick help will be appreciated.
>
>
> "Jens" <Jens@.sqlserver2005.de> wrote in message
> news:1132230042.794270.99970@.g43g2000cwa.googlegroups.com...
> -I think the issue is of max limit of charindex.
> No I don´t think so, because Charindex returns an INT, so there should
> be a problem if the character would be found at the
> 2,147,483,648 +1. So are you searching on the right table and database
> ? That should return a hit, if the word india is present in there.
> HTH, jens Suessmeyer.
>

an interesting problem

I manage a news database oriented website where there is a column named
'news' in a table 'news' storing huge HTML formatted artciles. I had to
replace a particular word 'india' by 'world' in all the records under this
column. Strange thing is the occurances of the word 'india' towards the end
of the articles are getting recognized by
select count(*) from news where charindex('india',news)>0
i.e. the above query results 0. Though there are thousands of records in
the column 'news' containing the word 'india'.
I think the issue is of max limit of charindex.
Please help at the earliest convenience of yours.
Regards,
John
-I think the issue is of max limit of charindex.
No I don=B4t think so, because Charindex returns an INT, so there should
be a problem if the character would be found at the
2,147,483,648 +1. So are you searching on the right table and database
? That should return a hit, if the word india is present in there.
HTH, jens Suessmeyer.
|||John
Did you try LIKE operator?
"John" <netconsul@.gmail.com> wrote in message
news:ePx4t626FHA.1140@.tk2msftngp13.phx.gbl...
>I manage a news database oriented website where there is a column named
>'news' in a table 'news' storing huge HTML formatted artciles. I had to
>replace a particular word 'india' by 'world' in all the records under this
>column. Strange thing is the occurances of the word 'india' towards the end
>of the articles are getting recognized by
> select count(*) from news where charindex('india',news)>0
>
> i.e. the above query results 0. Though there are thousands of records in
> the column 'news' containing the word 'india'.
> I think the issue is of max limit of charindex.
> Please help at the earliest convenience of yours.
> Regards,
> John
>
>
>
|||Thats what my problem is.
select news from news where news like '%india%'
results in 74000+ records while
select count(*) from news where charindex('india',news)>0
returns none.
I am using charindex to find the position of India in the record and use
'updatetext' to replace it by world.
because charindex('india',news) returns 0, updatetext cant replace india in
each record by world.
Any quick help will be appreciated.
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1132230042.794270.99970@.g43g2000cwa.googlegro ups.com...
-I think the issue is of max limit of charindex.
No I dont think so, because Charindex returns an INT, so there should
be a problem if the character would be found at the
2,147,483,648 +1. So are you searching on the right table and database
? That should return a hit, if the word india is present in there.
HTH, jens Suessmeyer.
|||Hi Everyone,
Solution to my problem lies here.
http://www.aspfaq.com/show.asp?id=2445
Please note that my fear about charindex is correct.
Initially I used CHARINDEX, but that failed if the pattern was deeper than
8,000 characters into the value. PATINDEX never dies. :-)
Thanks
John
"John" <netconsul@.gmail.com> wrote in message
news:eT7LVE66FHA.4076@.TK2MSFTNGP10.phx.gbl...
> Thats what my problem is.
> select news from news where news like '%india%'
> results in 74000+ records while
> select count(*) from news where charindex('india',news)>0
>
> returns none.
> I am using charindex to find the position of India in the record and use
> 'updatetext' to replace it by world.
> because charindex('india',news) returns 0, updatetext cant replace india
> in each record by world.
>
> Any quick help will be appreciated.
>
>
> "Jens" <Jens@.sqlserver2005.de> wrote in message
> news:1132230042.794270.99970@.g43g2000cwa.googlegro ups.com...
> -I think the issue is of max limit of charindex.
> No I dont think so, because Charindex returns an INT, so there should
> be a problem if the character would be found at the
> 2,147,483,648 +1. So are you searching on the right table and database
> ? That should return a hit, if the word india is present in there.
> HTH, jens Suessmeyer.
>

an interesting problem

I manage a news database oriented website where there is a column named
'news' in a table 'news' storing huge HTML formatted artciles. I had to
replace a particular word 'india' by 'world' in all the records under this
column. Strange thing is the occurances of the word 'india' towards the end
of the articles are getting recognized by
select count(*) from news where charindex('india',news)>0
i.e. the above query results 0. Though there are thousands of records in
the column 'news' containing the word 'india'.
I think the issue is of max limit of charindex.
Please help at the earliest convenience of yours.
Regards,
John-I think the issue is of max limit of charindex.
No I don=B4t think so, because Charindex returns an INT, so there should
be a problem if the character would be found at the
2,147,483,648 +1. So are you searching on the right table and database
? That should return a hit, if the word india is present in there.
HTH, jens Suessmeyer.|||John
Did you try LIKE operator?
"John" <netconsul@.gmail.com> wrote in message
news:ePx4t626FHA.1140@.tk2msftngp13.phx.gbl...
>I manage a news database oriented website where there is a column named
>'news' in a table 'news' storing huge HTML formatted artciles. I had to
>replace a particular word 'india' by 'world' in all the records under this
>column. Strange thing is the occurances of the word 'india' towards the end
>of the articles are getting recognized by
> select count(*) from news where charindex('india',news)>0
>
> i.e. the above query results 0. Though there are thousands of records in
> the column 'news' containing the word 'india'.
> I think the issue is of max limit of charindex.
> Please help at the earliest convenience of yours.
> Regards,
> John
>
>
>|||Thats what my problem is.
select news from news where news like '%india%'
results in 74000+ records while
select count(*) from news where charindex('india',news)>0
returns none.
I am using charindex to find the position of India in the record and use
'updatetext' to replace it by world.
because charindex('india',news) returns 0, updatetext cant replace india in
each record by world.
Any quick help will be appreciated.
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1132230042.794270.99970@.g43g2000cwa.googlegroups.com...
-I think the issue is of max limit of charindex.
No I dont think so, because Charindex returns an INT, so there should
be a problem if the character would be found at the
2,147,483,648 +1. So are you searching on the right table and database
? That should return a hit, if the word india is present in there.
HTH, jens Suessmeyer.|||Hi Everyone,
Solution to my problem lies here.
http://www.aspfaq.com/show.asp?id=2445
Please note that my fear about charindex is correct.
Initially I used CHARINDEX, but that failed if the pattern was deeper than
8,000 characters into the value. PATINDEX never dies. :-)
Thanks
John
"John" <netconsul@.gmail.com> wrote in message
news:eT7LVE66FHA.4076@.TK2MSFTNGP10.phx.gbl...
> Thats what my problem is.
> select news from news where news like '%india%'
> results in 74000+ records while
> select count(*) from news where charindex('india',news)>0
>
> returns none.
> I am using charindex to find the position of India in the record and use
> 'updatetext' to replace it by world.
> because charindex('india',news) returns 0, updatetext cant replace india
> in each record by world.
>
> Any quick help will be appreciated.
>
>
> "Jens" <Jens@.sqlserver2005.de> wrote in message
> news:1132230042.794270.99970@.g43g2000cwa.googlegroups.com...
> -I think the issue is of max limit of charindex.
> No I dont think so, because Charindex returns an INT, so there should
> be a problem if the character would be found at the
> 2,147,483,648 +1. So are you searching on the right table and database
> ? That should return a hit, if the word india is present in there.
> HTH, jens Suessmeyer.
>