declare @tableName VARCHAR(256), @id INT, @sql NVARCHAR(MAX)
set @id = 0
while(1=1)
begin
SELECT Top 1
@tableName = name,
@id = object_ID
FROM sys.objects
WHERE name LIKE 'Import%' -- Change to the table you would like to get the count.
AND type = 'U'
AND object_id > @id
ORDER BY object_ID
IF @@ROWCOUNT = 0
break
SET @sql = 'SELECT ''' + @tableName + ''' AS TableName, COUNT(1) AS CountRow FROM ' + @tableName
print @sql
EXEC (@sql)
end