try it
select * from information_schema.columns where DATA_TYPE in('text','ntext','xml','image') or (DATA_TYPE in('varchar','nvarchar','varbinary') and CHARACTER_MAXIMUM_LENGTH = -1) order by DATA_TYPE
filestream is stored as varbinary (max)
This will only capture varbinary (max), not varbinary (20), if you also want to then transfer varbinary to the first condition, for example, this
select * from information_schema.columns where DATA_TYPE in('text','ntext','xml','image','varbinary') or (DATA_TYPE in('varchar','nvarchar') and CHARACTER_MAXIMUM_LENGTH = -1) order by DATA_TYPE
source share