By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
9 rows affected
TableName | Count |
---|---|
Employee | 2 |
Student | 3 |
Teacher | 1 |
select [TableName] = 'Employee', [Count] = count(*) from [Employee] where tenantid = @tenantid union all
select [TableName] = 'Student', [Count] = count(*) from [Student] where tenantid = @tenantid union all
select [TableName] = 'Teacher', [Count] = count(*) from [Teacher] where tenantid = @tenantid