[dba-Tech] Function gotcha with use of asterisk

Arthur Fuller fuller.artful at gmail.com
Fri Sep 11 13:42:06 CDT 2009


IMO this is a bug due to bad programming on the developer's side. To wit:
To assemble all the columns, drag and drop their names from the UI. No big
deal. Perhaps if you have 244 columns it's a big deal, but in general I
forbid my developers from using * in lieu of a list of columns. As the
author said, he's lazy, but there is no excuse for being that lazy IMO. Far
better to name the columns of interest than to grab any and every thing
within the table. Most often you just want several columns of interest, not
them all, and using * is not only lazy but wasteful of resources.

Arthur

On Fri, Sep 11, 2009 at 12:44 PM, Max Wanadoo <max.wanadoo at gmail.com> wrote:

> Hi All,
>
> The u/m Gotcha was posted on sqlservercentral.  Below is the opening para.
> If you want to see code explaining this, etc, you will need a free
> subscription
>
> The home page is:
>
> http://www.sqlservercentral.com/
>
> The bug is at:
>
>
> http://www.sqlservercentral.com/articles/User+Defined+Function+%28UDF%29/627
> 30/
>
> Function gotcha with use of asterisk
> Introduction
>
> During a recent upgrade of our software, I discovered what I assume is a
> little-known gotcha that I feel appropriate to document and pass on. The
> gotcha occurs with user-defined table functions (UDFs), when selecting
> columns from a table using the asterisk (select all) method. The problem
> then occurs only when columns are subsequently added or removed from the
> based over table without recreating the function. When these conditions
> occur, it results in interesting and undesirable output. The SQL below
> illustrates this problem using SQL 2000.
>
>
> Watch for wrap
>
> Max
>
>
>
>
> _______________________________________________
> dba-Tech mailing list
> dba-Tech at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-tech
> Website: http://www.databaseadvisors.com
>



More information about the dba-Tech mailing list