When I need to bring something into cache (and there are use-cases for that, for example to shorten the time an offline index build takes), I use something like this:
SELECT COUNT_BIG(*)
FROM T WITH (NOLOCK, INDEX(IndexNameHere))
OPTION (MAXDOP 1)
And run that for each index. It doesn't get more efficient than this. The NOLOCK
is there to get an IAM scan instead of a b-tree-order scan.
Still, I'd like to find out why you want this. The DB will be brought gradually into cache when it is being used. Basically on the first access to a page that page is cached. Isn't that enough?