Posted by Shwetabh on 02/16/06 06:43
David Portas wrote:
> Shwetabh wrote:
> >
> > But the problem is that this database has to be accessed by a third
> > party
> > application which will need to access the required data using Partnum
> > as
> > keyword. In such scenario, it becomes neccessary to use select * from
> > ...
> > to get the row. How can I help it in such a case?
> > Also, will it be inefficient to use select * from .. if we have to
> > retrieve just 1
> > record or is it inefficient if more records have to be retrieved?
>
> Why would it be necessary to use SELECT * in such a scenario? SELECT *
> is slow because it requires extra work by the server to retrieve the
> column metadata. It's unreliable because more code may break if and
> when the table structure changes. It's hard to maintain because you
> can't easily search for column dependencies in your code during
> development.
>
> In another post you stated your application was VB so you should be
> able to create a stored procedure and call that from your VB code.
> Again, it's poor practice to put SQL code directly into applications if
> you can possibly avoid it.
>
> --
> David Portas, SQL Server MVP
>
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
>
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
I understand what you are saying. But consider this scenario:
A user needs a few more fields in the database and adds them to a table
kept for the purpose. Now how can _those_ fields be accessed without
using select *?
[Back to original message]
|