• ps_vbdev (3/5/2015)


    Thanks

    yes totally agree with you, but i inherited this issue and the time scales. we are a seasonal business so data fix has to wait until our low season, frustrating but it what ive to work with. i was just going to do a TOP 1 * order by Lastupdated desc but just thought there may be a better way.

    Either that or use ROW_NUMBER is about all you can do. I understand what you mean about slow seasons but in this case you have spent as much or more time working around the symptom as it would take to fix the problem. It also is going to make your queries slower. Hope you get it sorted out and hope you get the chance to clean up the mess.

    _______________________________________________________________

    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/