سؤال

Can we create an Index for TVP's(Table valued Parameters) in SQL Server 2008.

please can any one give the syntax.

Thanks In advance.. Vinay K

هل كانت مفيدة؟

المحلول

You can have primary key and unique constraints, which will automatically have indexes backing them, but you're unable to declare any indexes explicitly for table types


If you think your query could benefit from further indexes, pretty well you'll have to copy the rows from your TVP into a temporary table (not table variable), on which you can define any indexes you want. But obviously that will add some additional overhead (in time and memory costs)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top