Rogers,
You don't mention what you are ordering by (and perhaps also grouping by),
but assuming that the text column is not included in the ORDER BY or GROUP
BY clauses:
SELECT TOP 10 ID, colA, colB, colC
INTO #temp
FROM MyTable
ORDER BY colC, colB, colA
SELECT t.colA, t.colB, t.colC, m.textcolumn
FROM #temp t JOIN MyTable m
ON t.ID = m.ID
ORDER BY colC, colB, colA
This simply gets the text column out of the TOP 10, but returns it from the
second select.
RLF
"Rogers" <naissani (AT) hotmail (DOT) com> wrote
Quote:
I have a text column table and that contains 3000 records but when I try to
use top 10 query and include text column it take 10 minutes and when I
remove the text column from the select query it takes a second, any idea
how we can speed up the query if I include text column in my list. |