This is a really funny SQL Server bug dbfiddle.uk/iUmhLPln DECLARE @T table (i smallint NOT NULL PRIMARY KEY); INSERT @T (i) VALUES (256); SELECT TRY_CONVERT(tinyint, T.i) FROM @T AS T; SET STATISTICS XML ON; -- Oops! SELECT T.i FROM @T AS T WHERE TRY_CONVERT(tinyint, T.i) IS NULL;
1
4
13
702
3
@SQL_Kiwi @erikdarlingdata @t even bugs can give us a hearty laugh. code with humor is the best kind.