How do I retrieve the manipulated blob?
-
Through the this content SQL Server - BLOB Import and Export[^] and How to store and fetch binary data into a file stream column[^] , I was able to retrieve the blob from the FileImage column. But it doesn't work for some records. In other words, it opens with an error for this type of file that has been fetched. Table structure:
CREATE TABLE [dbo].[Attches](
[AttchID] [int] IDENTITY(1,1) NOT NULL,
[FileType] [varchar](30) NOT NULL,
[FileSize] [int] NULL,
[FileImage] [varbinary](max) NULL
)I tried to extract a damaged document or pdf file in raw form and opened it with Hexinator software. All the file that is corrupted, first its hex starts with the path of the file. In other words, it is manipulated. Is there a way to retrieve data safely? Best regards
-
Through the this content SQL Server - BLOB Import and Export[^] and How to store and fetch binary data into a file stream column[^] , I was able to retrieve the blob from the FileImage column. But it doesn't work for some records. In other words, it opens with an error for this type of file that has been fetched. Table structure:
CREATE TABLE [dbo].[Attches](
[AttchID] [int] IDENTITY(1,1) NOT NULL,
[FileType] [varchar](30) NOT NULL,
[FileSize] [int] NULL,
[FileImage] [varbinary](max) NULL
)I tried to extract a damaged document or pdf file in raw form and opened it with Hexinator software. All the file that is corrupted, first its hex starts with the path of the file. In other words, it is manipulated. Is there a way to retrieve data safely? Best regards
lookilok wrote:
But it doesn't work for some records
As stated this is not a database problem. Potential causes. Could be others. - You are not reading the entire contents completely. It works for some because the process you are using accidently reads if fully to the end or the lost parts are not actually needed. - You succeed for some because you make assumptions about what it is or how it should be used. So nothing at all to do with the database. For example you assume that every one is a pdf when if fact some are word docs. There should be information in the database that tells you what the type is. - The data is in fact corrupted in the database. So a data issue and absolutely no way you can fix it in code.
-
lookilok wrote:
But it doesn't work for some records
As stated this is not a database problem. Potential causes. Could be others. - You are not reading the entire contents completely. It works for some because the process you are using accidently reads if fully to the end or the lost parts are not actually needed. - You succeed for some because you make assumptions about what it is or how it should be used. So nothing at all to do with the database. For example you assume that every one is a pdf when if fact some are word docs. There should be information in the database that tells you what the type is. - The data is in fact corrupted in the database. So a data issue and absolutely no way you can fix it in code.
-
If we assume that this record is encrypted or compressed, Is there a way to show how the records with this problem were encrypted? What encryption or compress method?
Some encryptions and some compressions might put a signature at the beginning of the file. If it exists it is not guaranteed to be unique but likely is sufficient to guess about it. You would need to research each possibility. For example... "Conventionally the first thing in a ZIP file is a ZIP entry, which can be identified easily by its local file header signature. However, this is not necessarily the case, as this is not required by the ZIP specification - most notably, a self-extracting archive will begin with an executable file header." ZIP (file format) - Wikipedia[^]
-
Through the this content SQL Server - BLOB Import and Export[^] and How to store and fetch binary data into a file stream column[^] , I was able to retrieve the blob from the FileImage column. But it doesn't work for some records. In other words, it opens with an error for this type of file that has been fetched. Table structure:
CREATE TABLE [dbo].[Attches](
[AttchID] [int] IDENTITY(1,1) NOT NULL,
[FileType] [varchar](30) NOT NULL,
[FileSize] [int] NULL,
[FileImage] [varbinary](max) NULL
)I tried to extract a damaged document or pdf file in raw form and opened it with Hexinator software. All the file that is corrupted, first its hex starts with the path of the file. In other words, it is manipulated. Is there a way to retrieve data safely? Best regards
-
lookilok wrote:
But it doesn't work for some records
As stated this is not a database problem. Potential causes. Could be others. - You are not reading the entire contents completely. It works for some because the process you are using accidently reads if fully to the end or the lost parts are not actually needed. - You succeed for some because you make assumptions about what it is or how it should be used. So nothing at all to do with the database. For example you assume that every one is a pdf when if fact some are word docs. There should be information in the database that tells you what the type is. - The data is in fact corrupted in the database. So a data issue and absolutely no way you can fix it in code.
On the Initiate Restore tab, choose Azure Blobs (Azure Storage) as the Datasource type and select the Backup Instance you want to restore. The backup instance is the storage account that contains the blobs you want to restore. On the Select recovery point tab, select the type of backup you want to restore.