问题
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
回答1:
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)
来源:https://stackoverflow.com/questions/4645495/create-an-index-for-a-tvp-in-sql-2008