Try this....
CREATE TABLE #TEMP (Rid int identity , NAME VARCHAR(1000))
INSERT INTO #TEMP
exec SP_MSforeachDB 'USE ? Select TABLE_CATALOG+''..''+TABLE_NAME From Information_schema.Tables'
SET NOCOUNT ON
DECLARE @Cnt INT ,@I INT ,@Name VARCHAR(1000)
SET @I=1
SELECT @Cnt=Count(*) FROM #TEMP
WHILE @i<=@Cnt
BEGIN
SELECT @Name=Name FROM #TEMP WHERE Rid=@i
EXEC ('Select Top 1 * From '+ @Name)
SET @I=@I+1
END