• akberali67 (6/29/2013)


    Hi,

    Firstly, I Apologize for presenting the data the way I did.

    No problem, just remember for next time 😀

    akberali67 (6/29/2013)


    Just one final question is whether the numbers would be ordered or rather can they be ordered in the 'Sno_Retained' field.

    Thanks again,

    Akber.

    If you look at the code in the FOR XML bit, there is an "ORDER BY Sno". So the Sno_Retained will currently be ordered by the Sno. . . e.g, 1,2,3 rather than 3,1,2.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/