Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Major problem with indexing
Message
De
30/09/2008 12:07:55
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Major problem with indexing
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01351824
Message ID:
01351824
Vues:
56
I have a major problem with the indexing.

The following would find the related records:
DECLARE @Name char(20)
DECLARE @Name2 char(20)
DECLARE @ID integer
set @Name = 'A301041%'
set @Name2 = 'A301041%'
set @ID = 1

SELECT Client.Numero FROM Client WHERE (Client.Name LIKE @Name OR Client.Name2 LIKE @Name2) AND Client.ID=@ID
But, the following would not find any record:
DECLARE @Name char(20)
DECLARE @Name2 char(20)
DECLARE @ID integer
set @Name = 'A30104%'
set @Name2 = 'A30104%'
set @ID = 1

SELECT Client.Numero FROM Client WHERE (Client.Name LIKE @Name OR Client.Name2 LIKE @Name2) AND Client.ID=@ID
Can anyone explain me why the second query doesn't return any record? This doesn't make any sense to me. It should have at least the same number of records as the query string entered is having a wider range. I have done a Rebuild all on the indexes. I have done it twice and this didn't change anything.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform