what is the best way for me to query table with same table name but located in multiple db's in the same server ?
Here is my current scripts which only extract only in table and one db.
select ColumnA, count(*) as count from TableTest44 with ( nolock )
where (((sid = 1 and eventid = 1) AND nname <> '')
AND (datetime >= '2010-08-01 00:00:00.000' and datetime <'2010-08-31 23:59:59.999'))
AND (username NOT LIKE 'samkry%'