https://userapps.support.sap.com/sap/support/knowledge/en/2243932
2243932 - Table scan is chosen if local variable is used as a search argument and the query...
Table scan (or a suboptimal index scan if it exists) may be chosen if a local variable is used as a search argument like below. declare @col1 int select @col1...