title: Can a binary file be read as text?
body: <p>While the question heading is complete in itself, I'll provide some meta info as to how I hit this problem.</p>
  
  <hr>
  
  <p>With SQL Server and MySQL it was all good and fine with any kind of and any size of data but recently I started working with a DBMS that allows only a max of 64 KB of data in each column of a table. The limit of 64 KB is problematic when there is binary data in the columns. Other examples are - a column containing an image or an audio or a multimedia object or geospatial data.</p>
  
  <p>You won't always get images of size less than 64 KB. BLOBs can simply not be stored in such DBMS. The DBMS allows users to add to its capabilities by writing functions in C/C++ and calling them. But with even these functions we can return a max of 64 KB data per call.</p>
  
  <p>Somebody suggested me a workaround - </p>
  
  <blockquote>
    <p>store the binary data on file system and store an identifier to that
    particular binary data in the table's column. This way, when anyone
    requests that data, the data can be sent back to the caller in <em>chunks
    of 64 KB size each.</em></p>
  </blockquote>
  
  <p>But then the second limitation came up, which is that the data can be sent from the DBMS as one of the following datatypes only - char / varchar / integer / smallint / bigint / boolean / real. The most favoured candidate in this list was varchar(max) for obvious reasons (that it's the longest).</p>
  
  <p>So, <strong>can a binary file be read and sent as text?</strong> The client end which talks with DBMS is being developed in C#.</p>