我自己解决了:
SELECT
T.[name] AS [table_name], AC.[name] AS [column_name],
TY.[name] AS system_data_type
FROM [master].sys.[tables] AS T
INNER JOIN [master].sys.[all_columns] AC ON T.[object_id] = AC.[object_id]
INNER JOIN [master].sys.[types] TY ON AC.[system_type_id] = TY.[system_type_id]
EXCEPT
SELECT
T.[name] AS [table_name], AC.[name] AS [column_name],
TY.[name] AS system_data_type
FROM test.sys.[tables] AS T
INNER JOIN test.sys.[all_columns] AC ON T.[object_id] = AC.[object_id]
INNER JOIN test.sys.[types] TY ON AC.[system_type_id] = TY.[system_type_id]
这将为您提供列的列表以及表名、列名和数据类型,它们在主目录中但不存在或与测试不同。