<p>I have a .Net app that will allow the users to attach files to a SQL Server 2005 database.  I want to limit the filesize to 10MB, so from what I can tell, I have to declare the datatype varbinary(max), since the max size I can actually specify is 8000 bytes.  But the ~2GB filesize varbinary(max) allows seems like overkill.  Is there a way for me to limit it at 10MB in the database, or do I just need to check that they're not trying to attach something larger on the frontend.</p>

I think you need to make it in the frontend. You can limit the HTTP request size in the web.config like that:
```
```
</configuration>
   </system.web>
      <httpRuntime maxRequestLength="60000"/>
   </system.web>
</configuration>
```
```
You may also need to explicitly check the posted file size when the user try to upload a file more than the specified threshold.