In my MS SQL procedure am using table type variable as parameter. From front end the data table is created and passed to the stored procedure as parameter.
Grid from UI:
Salary --- MonthOfPayment
600 ------ 3
300 ------ 1
800 ----- 2
I want the data to be inserted in the order in which the user has entered the salary data in the grid. But I noticed while inserting the data 300 always getting inserted first, then 600 and then 800.
In spite of the data table having first row as 600, second row 300 and third row 800 the data keeps inserting in ascending order of salary always.
How to retain the inserting order as passed in the data table.
I have used merge join existing table with the table type paramter. Is it affecting insert order?
Thanks in Advance,