AAA
AAA

Reputation: 31

How to get file type from binary data in SQL Server File table?

I want to get file type from binary data in a column File_Stream in FileTable.

In FileTable, there is File_Type column but it's not reliable.

Pay attention to the following queries:

These files are the same!

PIC

Upvotes: 0

Views: 1290

Answers (1)

Dan Guzman
Dan Guzman

Reputation: 46241

The file_type column value is derived from the file name, not the binary contents of the file. SQL Server has no notion of what the actual binary contents represent.

Upvotes: 3

Related Questions