我沒有SSRS/Visual Studio,我正在SSMS中運行多個查詢。 第一個查詢提供了所有的數據的總體概要:將多個不同查詢的結果導出到Excel?
Select
'All Divisions',
Count(b.EmployeeID) As Numerator,
Count(a.EmployeeID) As Denominator,
Cast(Count(b.EmployeeID) As nvarchar) + '/' + Cast(Count(a.EmployeeID) As nvarchar) As FinalRatio
從 @ TBL1左連接 @ TBL2 b在a.EmployeeID = b.EmployeeID
第二個查詢:
Select
a.Division,
Count(b.EmployeeID) As Numerator,
Count(a.EmployeeID) As Denominator,
Cast(Count(b.EmployeeID) As nvarchar) + '/' + Cast(Count(a.EmployeeID) As nvarchar) As FinalRatio
From
@tbl1 a Left Join
@tbl2 b On a.EmployeeID = b.EmployeeID
Group By a.Division
...第三個有沒有彙總/彙總的所有細節。
是否可以在一次操作中將所有三個結果集導出到一個Excel電子表格中 - 手動還是其他方式?