Padmaja.
Create a tabular function
which takes input VACHAR(1000)
Returns Table (id identity(1,1),FindNo int)
Write a code to insert the comma seperated string into the table
SELECT * FROM fn_gettblOrder('5,1,3,8,2')
id FIndNo
1 5
2 1
3 3
4 8
5 2
Now u can use Ur query with JOin of this Function....
select Col_1,Col_2 from @table
JOIN (SELECT id,findNo FROM fn_gettblOrder('5,1,3,8,2')) Ftbl on Ftbl.findNo=Col_1
where Col_1 in(5,1,3,8,2) order by id ASC
U may get the O/p what u expected.....& Use this same function where u need to get table from CSV values....
:-):-)
Thanks!
Sasidhar Pulivarthi