Thus, for example, the decimal number 11 is represented by B in the hexadecimal system and decimal 14 is represented by E. The numbers 0 through 9 are the same in both systems however, the decimal numbers 10 through 15 are represented by the letters A through F. The only thing that was still confusing was that I needed to used a convert SQL clause to retrieve the data as text although it was still Hex encoded just no longer binary.Hexadecimal (Hex) is used in the transfer encoding Base16, in which each byte of the plaintext is broken into two 4-bit values and represented by two hexadecimal digits. I'll mark this as an answer once I get the project to the next stage. Thanks to all those who thought about this problem :) No I have to put my money where my mouth is and make it happen but at least I have a workable plan now. I can't report on historic data as it is still compressed but this is no big deal as the users are interested in reporting on trends over the last week or so. There could be an initial growth in my overall storage size as the file system tried to compress already compressed data. I plan to do the reporting as a scheduled task and if someone really wants to find and restore an archived email guess who they are going to ask! The search routing for locating messages in the backup doesn't look through this compressed data in any case. I know this could potentially have an unknown performance impact as I have moved the compression / decompression from one place to another but who knows it may get better :) Overall performance isn't a big deal as there is almost no online user interaction with the backup database. That is to say it is a varbinary(max) column with FileStream enabled and the actual data is stored directly in the NTFS file system outside of the database.mdb file.Īfter much reading of best practices and "never do this's" I have enabled NTFS file compression on the FileStream data folder and turned off compression in the Backup application. The RFC822_msg column that I'm trying to decode is actually a FileStream column. I think I have come up with a workaround solution. I have tried to open the resulting file with 7zip and Windows built in ZIP. The database table also has a column named "ZIPCOMPRESSION" and is 1 or 0 depending on wether compression is on or off.ĭoes anyone have any ideas how I can read the compressed text. I'm Using Visual Studio 2008 and SQL Server 2008 R2 and the backup software is Policy Patrol. Either my little program doesn't decode it properly back into a binary file or I haven't yet guessed what the backup software has used to compress the text. I figure that I must first decode it back into a binary file then decompress it. ![]() (not the same email as above but it is going to be very similar)ĠxCD396B8C23C959E599BB7DCCED240B977B26DCD47995DBDBBB69BBDBAFB17B6 The compressed hex string starts like this. If (hexString = null || (hexString.Length & 1) = 1)ĭecoded Result = Received: from COMPANYSRV.campsie Static string hexStringToString( string hexString) ![]() String result = hexStringToString(input)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |