tags:

views:

30

answers:

2

In the similar query Update on #temp table is faster then the @ table variable.

But I m forced to use table variable as I am wokring with function. I feel index is not being picked up for table variable. I have unique clustered index.

Please help

+1  A: 

Have a look here

There is no way to explicitely generate indexes on table variables and no statistics are kept for any indexes generated by contstraints.

Chris Bednarski
My update query on table variable takes 56 sec same query with temp table takes 13 sec. Thats a huge performance difference.I can't pass temp table everytime to this function as that function is being called from different places.Is there any workaround for this problem ?
A: 

My update query on table variable takes 56 sec same query with temp table takes 13 sec. Thats a huge performance difference. I can't pass temp table everytime to this function as that function is being called from different places. Is there any workaround for this problem ?