Geoff, where did you get the conclusion of every column being
searched upon using the find? From my code above the following
paramertized query is created (SQL 2005)
exec sp_executesql N'
BEGIN
WITH PageIndex AS (
SELECT TOP 2147483647 row_number() OVER (ORDER BY [Name]) AS RowIndex
, [NameId]
, [Name]
, [OriginID]
, [Origin]
, [Sex]
, [Description]
, [SoundEx]
FROM [dbo].[AllNames] where (Name LIKE @Param0)
)
SELECT
[NameId],
[Name],
[OriginID],
[Origin],
[Sex],
[Description],
[SoundEx]
FROM PageIndex
WHERE RowIndex > 0
AND RowIndex <= 2147483647
ORDER BY [Name];
-- get total count
SELECT COUNT(*) AS TotalRowCount FROM [dbo].[AllNames] where (Name LIKE @Param0);
END
',N'@Param0 nvarchar(4)',@Param0=N'ric%'
What might
slow it down is the paging as technically the user has not specified whether this is necessasry, I have not tested this against a custom
stored procedre but I bet the results are not to far apart.
Richard Wilde
wildesoft.net