SQL | Find all tables that have varbinary datatype (or any data type)

This came in handy when I had to find all the tables in a database that had ‘varbinary’ datatype columns. You can replace the ‘varbinary’ text to find any type you are looking for.

SELECT 
      table_name [Table Name], column_name [Column Name]
FROM 
      information_schema.columns 
WHERE 
      DATA_TYPE  = 'varbinary'

Leave a comment