Dump all Views of multiple databases in SQL Server
You will certainly need the right permissions to view the views definition. This should work for you. Please note that I'm using the undocumented sp_MSforeachdb stored procedure. This means that it could change without notice so is not advisable to include as part of your production/live tsql code as it could fail. Check Aaron comment about it.

EXEC sp_MSforeachdb '
    IF DB_ID(''?'') &gt; 4
    BEGIN
        USE [?]
        SELECT DB_NAME()
        SELECT  c.text
            FROM    sysobjects o
                    JOIN syscomments c
                        ON c.id = o.id
            WHERE   o.type = ''V'';
    END'