busquedas ignorando acentos

05/03/2008 - 15:46 por Piolin Net | Informe spam
Alo!

Hay alguna manera facil en sql de hacer busquedas con LIKE ignorando los
acentos? o me voy a tener que hacer una funcioncilla que me los reemplace?

gracias.

Preguntas similare

Leer las respuestas

#1 Gux (MVP)
05/03/2008 - 15:55 | Informe spam
use tempdb
go

create table t (col1 char(20))
go

insert t values ('raton')
insert t values ('ratón')
insert t values ('ratòn')
insert t values ('ratön')
insert t values ('ratones')
go

select col1 from t where col1 COLLATE SQL_Latin1_General_CP850_CI_AI like
'rato%'

Gustavo Larriera, Microsoft MVP
https://mvp.support.microsoft.com/profile/gux
Este mensaje se proporciona tal como es, sin garantías de ninguna clase.



"Piolin Net" wrote:

Alo!

Hay alguna manera facil en sql de hacer busquedas con LIKE ignorando los
acentos? o me voy a tener que hacer una funcioncilla que me los reemplace?

gracias.
Respuesta Responder a este mensaje
#2 Piolin Net
05/03/2008 - 16:21 | Informe spam
gratxe.

y si el acento va en la variable de busqueda?

like 'rató%' he de poner ahi tb el COLLATE?

select col1 from t where col1 COLLATE SQL_Latin1_General_CP850_CI_AI like
'rató%' COLLATE SQL_Latin1_General_CP850_CI_AI

¿?

"Gux (MVP)" wrote:

use tempdb
go

create table t (col1 char(20))
go

insert t values ('raton')
insert t values ('ratón')
insert t values ('ratòn')
insert t values ('ratön')
insert t values ('ratones')
go

select col1 from t where col1 COLLATE SQL_Latin1_General_CP850_CI_AI like
'rato%'

Gustavo Larriera, Microsoft MVP
https://mvp.support.microsoft.com/profile/gux
Este mensaje se proporciona tal como es, sin garantías de ninguna clase.



"Piolin Net" wrote:

> Alo!
>
> Hay alguna manera facil en sql de hacer busquedas con LIKE ignorando los
> acentos? o me voy a tener que hacer una funcioncilla que me los reemplace?
>
> gracias.
Respuesta Responder a este mensaje
#3 Gux (MVP)
05/03/2008 - 16:29 | Informe spam
No sea perezoso: Usted mismo no puede probar si eso funciona?

Gustavo Larriera, Microsoft MVP
https://mvp.support.microsoft.com/profile/gux
Este mensaje se proporciona tal como es, sin garantías de ninguna clase.



"Piolin Net" wrote:


gratxe.

y si el acento va en la variable de busqueda?

like 'rató%' he de poner ahi tb el COLLATE?

select col1 from t where col1 COLLATE SQL_Latin1_General_CP850_CI_AI like
'rató%' COLLATE SQL_Latin1_General_CP850_CI_AI

¿?

"Gux (MVP)" wrote:

> use tempdb
> go
>
> create table t (col1 char(20))
> go
>
> insert t values ('raton')
> insert t values ('ratón')
> insert t values ('ratòn')
> insert t values ('ratön')
> insert t values ('ratones')
> go
>
> select col1 from t where col1 COLLATE SQL_Latin1_General_CP850_CI_AI like
> 'rato%'
>
> Gustavo Larriera, Microsoft MVP
> https://mvp.support.microsoft.com/profile/gux
> Este mensaje se proporciona tal como es, sin garantías de ninguna clase.
>
>
>
> "Piolin Net" wrote:
>
> > Alo!
> >
> > Hay alguna manera facil en sql de hacer busquedas con LIKE ignorando los
> > acentos? o me voy a tener que hacer una funcioncilla que me los reemplace?
> >
> > gracias.
Respuesta Responder a este mensaje
#4 Piolin Net
05/03/2008 - 16:35 | Informe spam
jajaja, con un si o un no me hubiera valido ... no es por pereza sino para
que si eso no funciona tuviera la solucion mientras lo probaba.

"Gux (MVP)" wrote:

No sea perezoso: Usted mismo no puede probar si eso funciona?

Gustavo Larriera, Microsoft MVP
https://mvp.support.microsoft.com/profile/gux
Este mensaje se proporciona tal como es, sin garantías de ninguna clase.



"Piolin Net" wrote:

>
> gratxe.
>
> y si el acento va en la variable de busqueda?
>
> like 'rató%' he de poner ahi tb el COLLATE?
>
> select col1 from t where col1 COLLATE SQL_Latin1_General_CP850_CI_AI like
> 'rató%' COLLATE SQL_Latin1_General_CP850_CI_AI
>
> ¿?
>
> "Gux (MVP)" wrote:
>
> > use tempdb
> > go
> >
> > create table t (col1 char(20))
> > go
> >
> > insert t values ('raton')
> > insert t values ('ratón')
> > insert t values ('ratòn')
> > insert t values ('ratön')
> > insert t values ('ratones')
> > go
> >
> > select col1 from t where col1 COLLATE SQL_Latin1_General_CP850_CI_AI like
> > 'rato%'
> >
> > Gustavo Larriera, Microsoft MVP
> > https://mvp.support.microsoft.com/profile/gux
> > Este mensaje se proporciona tal como es, sin garantías de ninguna clase.
> >
> >
> >
> > "Piolin Net" wrote:
> >
> > > Alo!
> > >
> > > Hay alguna manera facil en sql de hacer busquedas con LIKE ignorando los
> > > acentos? o me voy a tener que hacer una funcioncilla que me los reemplace?
> > >
> > > gracias.
email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida