...and, if you have less that 250 or so databases, the following will beat the pants off your cursor 😉
[font="Courier New"]--===== Declare local variables
DECLARE @SQL VARCHAR(8000) --Holds the dynamic SQL
--===== Build the dynamic SQL
SELECT @SQL = ISNULL(@SQL+' UNION ALL'+CHAR(10),'')
+ 'SELECT u.tp_Login,''' + Name + ''' FROM [' + Name + ']..Sites s INNER JOIN ['
+ Name + ']..UserInfo u ON s.OwnerID=u.tp_ID'
FROM Master.dbo.SysDatabases
WHERE Name LIKE '%somefilter%'
--===== Execute the dynamic SQL to get the result set
EXEC (@SQL)[/font]
--Jeff Moden
Change is inevitable... Change for the better is not.