Re: Text column in select query
- From: "Russell Fields" <russellfields@xxxxxxxxxx>
- Date: Mon, 26 Mar 2007 14:49:26 -0400
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@xxxxxxxxxxx> wrote in message
news:OOaI$Z8bHHA.4716@xxxxxxxxxxxxxxxxxxxxxxx
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.
.
- References:
- Text column in select query
- From: Rogers
- Text column in select query
- Prev by Date: Text column in select query
- Next by Date: SQL Server 2005 backup
- Previous by thread: Text column in select query
- Next by thread: SQL Server 2005 backup
- Index(es):
Relevant Pages
|