我正在开发一个 SQL 存储过程,我想返回每个表的行数。我怎样才能重写这个语句,以便它列出下面每个表的行数?
SELECT COUNT(*)
FROM [test_setup_details_form_view] [tsdf]
JOIN [test_setup_header_form_view]
ON [test_setup_header_form_view].[test_setup_header_id]
= [tsdf].[test_setup_header_id]
JOIN [test_header_rv] [th] with(nolock)
ON [th].[test_setup_header_id]
= [test_setup_header_form_view].[test_setup_header_id]
JOIN [test_details_answers_expanded_view] [tdae]
ON [tdae].[test_setup_details_id] = [tsdf].[test_setup_details_id]
AND [th].[test_header_id] = [tdae].[test_header_id]
JOIN [event_log_rv] [e]
ON [e].[event_log_id] = [tdae].[event_log_id]
当我执行这个语句时,它只是给了我所有连接之后的总行数。