var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Indexes on table variable of table valued function
Can someone tell me if it is possible to add an index to a Table variable that is declare as part of a table valued function ? I've tried the following but I can't get it to work.
ALTER FUNCTION dbo.fnSearch_GetJobsByOccurrence
RETURNS @Result TABLE (resultcol1 int, resultcol2 int)
CREATE INDEX resultcol2_ind ON @Result
-- do some other stuff
Non-clustered indexes cannot be created on table variables, other than the system indexes that are created for a PRIMARY or UNIQUE constraint.
Thanks for the reply. That link certainly explains it all.
Also I didn't realise that table variables can be stored on disk if MSSQL deems necessary! Taking everything into account I would think temporary tables are somewhat more useful/versatile!?