In SQL Server 2005 and 2008 R2, I'm calling into a stored procedure that has an out parameter defined as
varbinary(max). The out parameter returns 10020 bytes according to
However, SQL Server errors if I try to define a varbinary with > 8000 bytes such as varbinary(10000). E.g.
The size (10000) given to the type 'varbinary' exceeds the maximum allowed for any data type (8000).
What is happening here? How can SQL Server return more bytes than allowed in the data type? Is SQL Server using some other data type behind the scenes to hold > 8000 bytes?