SQL Server Cardinality Estimation Warning How can I fix the following cardinality estimation warning?
while exists(select 1 from @images)
begin
   declare @imageid     int
   declare @filename    varchar(max)
   select TOP (1)
      @imageid = [imageid],
      @filename = concat([imageid], '.', [extension])
   from
      @images
   order by
      [imageid]
   ...
   delete @images where [imageid] = @imageid
end


SQL Server Compatibility Level: SQL Server 2019 (150)
Sometimes the warning is nothing more than that, just a warning, and not something actually affecting performance.
The two things that are most likely affecting your performance are the Table Variable, and the fact you're looping instead of using a more relational solution. So I'd first run a SELECT * INTO #images FROM @images to put it inside of a Temp Table before your WHILE loop, and then use that Temp Table inside the loop instead, to potentially improve performance.
To answer your question though, I believe the fact that your imageid is an INT but you're using it in a string function like CONCAT() is where the Implicit Conversion is coming from that is inducing that Cardinality Estimate warning. If you stored a copy of it in your @images table variable already casted as a string data type that was the same type as the extension field and used it in the CONCAT() function instead then the warning should go away.
Also, Table Variables typically result in poor Cardinality Estimates themselves because of their lack of statistics, which may be why the &quot;Estimated Number of Rows Per Execution&quot; is showing 1. (Note there's been improvements in SQL Server 2019.)