Is there a way in SQL Server to accomplish the following (execute a query as a column using the results from another column)?
use mydb
go
select
a.*,
select count(*) from a.table_name
from
(select
(select version from mydb.version) as AppVersion,
table_Schema, table_name
from
information_schema.tables
where
table_type = 'BASE TABLE'
and TABLE_CATALOG = db_name()) as a
order by
a.table_name