我是如何将特定数据库Adventureworksdw,NorthWind的以下更改作为单个结果集进行的。
-- Modified Tables
SELECT NAME, TYPE, TYPE_DESC, CREATE_DATE, MODIFY_DATE FROM SYS.OBJECTS
WHERE TYPE ='U' ORDER BY MODIFY_DATE DESC
答案 0 :(得分:0)
您可以使用以下查询。
SELECT
'Adventureworksdw' AS SourceDatabase,
NAME,
TYPE,
TYPE_DESC,
CREATE_DATE,
MODIFY_DATE
FROM Adventureworksdw.SYS.OBJECTS
WHERE
TYPE ='U'
UNION ALL
SELECT
'NorthWind ' AS SourceDatabase,
NAME,
TYPE,
TYPE_DESC,
CREATE_DATE,
MODIFY_DATE
FROM NorthWind.SYS.OBJECTS
WHERE
TYPE ='U'
ORDER BY MODIFY_DATE DESC