Yes, it works, it's easy enough to write code to prove it:
;with tbltest as (select cast('ab012' as varchar(5)) as TestNumber) select * from tblTest where TestNumber = cast(20012 as varchar(5))
Just trying to think of some way to justify a "no" answer, presumably the column would always be padded to 5 chars (which means it should be char(5) not varchar(5)), and thus the conversion should?! be:
right('0000' + cast(<numeric_value AS varchar(5)), 5)
Maybe?! that's what they meant. But that's not the actual q, and to me the answer is clearly YES.
SQL DBA,SQL Server MVP(07, 08, 09) Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: "If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them."