Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Partitioned views : how to filter on the partition key in a stored procedure ?

$
0
0

I am using partitioned views in SQL Server 2008 R2.

When I create a query filtering on the partition key (customerID), I get partition elimination as expected.
But when I use a variable to filter on the partition key in a stored procedure, all tables in the partitioned view are hit !  (this is visible in the execution plan).

Is this a know behaviour ? Isn't it possible to run stored procs to filter data against a partition key ?

Thank you


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>