tmpreston wrote:
Hi,
I recently was asked to conduct a test of an application under dial-up (56k) link conditions. This pointed out a number of areas where too much data was being retrieved etc but I also noticed that the SQL text (displayed in SQL Profiler) is incredibly verbose. In certain testing situations there is more data being sent upstream in the unicode command text than is being retrieved. If an entity is being fetched, or a typed view where all the columns are being fetched it would be more useful if the generated SQL specified the query as SELECT * FROM ... rather than SELECT [dbo].[object].[columnA] AS [ColumnA].
SELECT * FROM is slower (according to sqlserver experts). Also, if the table gets another column, it is not ending up in the resultset until you change your client code. This is good. Also, at the moment you can't select a subset of the fields in an entity /view but this is added soon. The underlying code is then not changed, just the client code.
The sql is verbose, admitted, but it helps sqlserver find where to get the data way more easily. In theory you have to specify all these items anyway, you often don't have to as sqlserver can guess where to get the data, but it would be better if the query contained the information already.
The problem with less verbose sql is that you have to test a lot to be sure the sql isn't ambiguistic, i.e.: all columns are properly aliassed and it won't end up in an error. I'm not sure this is worth the effort.