cyberlabs.us | home | subscribe | contact | admin
Monday, July 7th  
MS-SQL Query for Binary File Detection
Informational

select t.table_schema as schema_name,
    t.table_name, c.COLUMN_NAME
from information_schema.columns c
    inner join INFORMATION_SCHEMA.tables t
        on c.TABLE_SCHEMA = t.TABLE_SCHEMA
        and c.TABLE_NAME = t.TABLE_NAME
where t.TABLE_TYPE = 'BASE TABLE'
and ((c.data_type in ('VARCHAR', 'NVARCHAR') and c.character_maximum_length = -1)
or data_type in ('BINARY','TEXT', 'NTEXT', 'IMAGE', 'VARBINARY', 'XML', 'FILESTREAM'))
order by t.table_schema, t.table_name  

August 20th, 2022 - 08:44 am | read more | comments  

Comment on this post.

Comments

Name