Merge Join issue during insert

Posted by Mokkarasu under Sql Server on 2/17/2015 | Points: 10 | Views : 465 | Status : [Member] | Replies : 1
hi all,

In my project am using table type varibale as paramter with the columns of id salary to the table. In my procedure i have used merge join with the passed table type variable with the existing table.Insert the value given id does not match,update the value to the id if matched this is the condition to my merge join. I passed the below table as parameter. Every id is new so i passed the id as -1. My problem is, when i insert the below table with my procedure it is not maintainig order. For example during insert 600 should be first,300 should be second and 800 should be third row, but am not getting like that it always save ascending order 300,600,800 respectively. Am i facing this issue since am using merge join?if so can any one help me to maintain order during insert.

My table type variable paramter value has been given below

id salary
-1 600
-1 300
-1 800


Posted by: Skraghava on: 2/22/2015 [Member] Starter | Points: 25


Can you please post your query, we can change the query and insert in the way you required.

Thanks and regards,
Raghavendra SK

Mokkarasu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response