>Ok, I have more data on this.
>
>I succeeded to simplify the SQL select where it shows me where the slow down is occuring.
>
>I have this presently:
>
>
>SELECT TOP 101 Client.Numero,Client.Name,Client.Street
> FROM Client
> WHERE (Client.Name LIKE '242401%' OR Client.Altern_Name LIKE '242401%') AND Client.NoInvoice=3
> ORDER BY Client.Name
>
>
>When executing that SQL from my VB.NET application, this will take about 56 seconds. But, executing the same SQL from the SSMS environment returns my record in a flash.
>
>However, executing this from my VB.NET application would also return the result in a flash:
>
>
>SELECT TOP 101 Client.Numero,Client.Name
> FROM Client
> WHERE (Client.Name LIKE '242401%' OR Client.Altern_Name LIKE '242401%') AND Client.NoInvoice=3
> ORDER BY Client.Name
>
>
>The only change was to remove the Street name. So, what is causing this exactly. There seems to be some verification on the Street name field if I include it such as taking 56 seconds but I would get an instant result if I do not include it. But, I need to have that field in there so I need to find out what is the factor here.
Just a speculation, but have you tried to move Street to the first place in the field list? Is this field still a culprit?
If it's not broken, fix it until it is.
My Blog