• T.Ashish (9/30/2013)


    If ordinal position of column is used instead of column name, then a new programmer will always have to look into the table to find out which column is used for sorting.

    You add a column somewhere in the start or middle or your table and all ordinals will be changed. Now you have to correct all of your queries.

    In addition to Dwain's corrections, the actual columns in the table are not the most common change. Let's say somebody wants to add a new column to the query but they want this new column as the first column. This required no changes to the tables but the ordinal position of the original columns has changed.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/