You can use the sp_MSforeachdb stored proc. It is an undocumented stored proc, but everyone seems to use it without a second thought. You would do something like this, for example:exec sp_MSforeachdb
'select
''?'' AS [Database],
[COLUMN_NAME],
[CHARACTER_MAXIMUM_LENGTH]
from
[?].[Information_schema].[columns]
where
[DATA_TYPE] = ''nvarchar''';