How can I get partition elimination with a variable?
In this case, adding an OPTION(RECOMPILE) hint to the query will get you the plan you want.

DECLARE @ServerID int = 1;

SELECT *
FROM vwTransactions
WHERE ServerID = @ServerID
OPTION (RECOMPILE);


The hint allows SQL Server to compile a plan specific to the current value of @ServerID. More specifically, it enables the Parameter Embedding Optimization, meaning the query is compiled as if you had written WHERE ServerID = 1, allowing partition elimination.