1
我可以知道如何将此查询的结果输出为此格式?将列转换为SQL Server 2012中的行
查询
Select *
from sys.databases
where name = 'your_db_name'
原始输出:
name databaseid source_database_id owner_sid
xxx xxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxx
所需的输出:
Parameter Value
name xxxxx
databaseid xxxxx
source_database_id xxxxxx
owner_sid xxxxxx
你可能想'CAST'将'Value'设置为'VARCHAR'。 –
@FelixPamittan - 是的,没有检查名称列 –
谢谢!!!!!!!!!!!!!! – user664481