Table variable with primary key, will it create clustered index?

  • Hi,

    If i declare a table variable with the primary key will it create clustered index.

    If yes where can i see that information?

    if NO why?

    Thanks,

    🙂

  • It does create a system index, that's how SQL Server maintains the unique values in the table. But, there are no statistics for the index, so it won't really be used to make the query run better.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply