I set up FileSTream on my SQL Server database. Files were created on file system, that was all OK. Then due to some incident, some files were deleted off the file system. But SQL still points rows to files. When I try to set new bytes[] in FileStream column, I have an error (because in order to set up new bytes[], SQL first tries to delete old file on file system, but can't find it since it's already removed from file system). How can I do to set new bytes[] to rows where file has been deleted without getting this error ? How to deal with this kind of mistakes ?
Asked
Active
Viewed 168 times
1
-
This isn't a simple mistake, you deleted the data. It's the same kind of problem as dropping or truncating a table. If this happened in production, you'd have to restore from a good backup. In this case you may try truncating the table – Panagiotis Kanavos May 16 '17 at 10:21
-
In any case, this isn't related to programming. Perhaps you'd get a different answer if you asked in dba.stackexchange.com – Panagiotis Kanavos May 16 '17 at 10:22
-
Actually I don't need to restore anything, I just ant to set new values in the FileStream column. I wonder if there is a command to detect corrupted rows or something that could help me with this situation – bob May 16 '17 at 10:24