• deepkt (7/9/2013)


    Hi,

    I have one requirement and need help.

    I have a table:

    CREATE TABLE MiscItems(ID INT, Description VARCHAR(50), DisplayOrder SMALLINT)

    INSERT INTO MiscItems(ID,Description,DisplayOrder)

    SELECT 100, 'A1',1

    UNION ALL

    SELECT 101,'A2',2

    UNION ALL

    SELECT 102,'A3',3

    UNION ALL

    SELECT 104,'A4',4

    UNION ALL

    SELECT 105,'A5', 5

    UNION ALL

    SELECT 106,'A6',6

    SELECT * FROM MiscItems

    DROP TABLE MiscItems

    I will display in UI: Description & Displayorder and both are editable in UI.

    My requirement is User can modify DisplayOrder of his interest and clicks on save, then accordingly the display order should be saved in table.

    User can change multiple items at once and accordingly data should be re arranged and saved in table.

    Display order will not be a zero & non negative value.

    please help..

    Not entirely sure what you are asking here. Part of your question sounds like you want to use a parameter as your sort order. This is certainly feasible. The other part makes it sound like you want store this sort order or something??? Keep in mind that the ONLY way to ensure order of rows from a table is to add an ORDER BY to your query.

    _______________________________________________________________

    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/