[code] select a, b, c from tablea a1 where a1.a IN (select a2.a from table2 a2)
[code]
And I have been told by another developer I should put an index on the a2.a column as it will do a full table scan.
I do not have much experience with indexes at all and not sure what type of index I need to put in?
Can someone tell me what type of index and a basic syntax to implement it, or a way to do it in management studio? Reading up on clustered and non-clustered and after reading it doesn't make any sense really to me what it is I need.
I don't see any other indexes on it, primary key etc. and checked sys.index table and there is no index id for this table. I'm assuming bol = books online?
Consider an index on a1.a including b,c - or clustered index on a non-clustered index on a2.a
Depends on the size of the tables and column data as to how effective this will be or whether it will make a difference.
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy.