Papa
Thu Apr 07 14:17:04 CDT 2005
I agree that dynamic SQL to get your data is the way i would go in this
situation. You could also consider using FOR XML to return the data, but
frankly I would stick with grabbing the row via a DataTable or a DataReader
and test your performance.
John Papa
http://codebetter.com/blogs/john.papa
"Sahil Malik [MVP]" wrote:
> I meant - stay away from writing your own cursor.
>
> Anyway, 100-200 columns in a table .. EEEEEEEEEEEEEEEEEEEE !!!!
>
> But I'm gonna try and stay out of optimizing your database.
>
> If you are sure that the query structure doesn't change too often, I say use
> dynamic SQL to fetch the data you need.
> How much data are we talking? (Rows?)
>
> - Sahil Malik [MVP]
>
http://codebetter.com/blogs/sahil.malik/
>
>
>
> "Jim Brandley" <jim.brandley@intercim.com> wrote in message
> news:1112642163.616688.210270@z14g2000cwz.googlegroups.com...
> > Are you saying that opening a datareader or filling a datatable do not
> > create cursors on the database server? I do not see how those functions
> > could be performed without a cursor.
> >
> > I am constructing the select statement dynamically based on the content
> > of the request, and generating input parameters to match. Some of the
> > tables I have to query have 100 - 200 columns, and I do not want to
> > retrieve all for the (generally small) subset the users require. These
> > forms do not change frequently, once or twice while the users configure
> > the package to suit their needs, thereafter only as their business
> > rules and requirements change. The prepared statements should remain in
> > the db server cache most of the time, because I always generate the
> > same select. The returned data lives on the web server only for a short
> > time, and is likely different content (same columns but different
> > different rows) for each session.
> >
>
>
>