0
我使用Microsoft SQL Server 2008年回國,我嘗試了所有的3個解決方案,但每次我得到同樣的錯誤無法檢索列信息:沒有科拉姆信息由SQL命令
Error at Data Flow Task[OLEDB source[449]]:No colum information was returned by the sql command
我使用以下批量的sql語句來檢索我公司中所有服務器的服務器級配置。表變量@tb1_SvrStng
有83列,它使用不同的資源填充。
所以我總結了sql腳本。我不能將它用作存儲過程,因爲此腳本將針對14臺服務器(每臺服務器一次)運行。因此,如果我將該過程存儲在一臺服務器上,則其他服務器無法在其上下文中執行該過程。
我將非常感謝您的幫助。我沒有在腳本中使用任何臨時表。
declare @tb1_SvrStng table
(
srvProp_MachineName varchar(50),
srvProp_BldClrVer varchar(50),
srvProp_Collation varchar(50),
srvProp_CNPNB varchar(100),
...
xpmsver_ProdVer varchar(50),
..... .
syscnfg_UsrCon_cnfgVal int,
.....
);
insert into @tb1_SvrStng
(
srvProp_BldClrVer,
srvProp_Collation,
srvProp_CNPNB , ........
........ .
)
select convert(varchar, serverproperty('BuildClrVer')),
convert(varchar, serverproperty('Collation'))
........
.......
declare @temp_msver1 table
(
id int, name varchar(100),
...........
);
insert into @temp_msver1 exec xp_msver
Update @tb1_SvrStng
set xpmsver_ProdVer =
(
select value from @temp_msver1 where name = 'ProductVersion'
),
xpmsver_Platform =
(
select value from @temp_msver1 where name = 'Platform'
),
.....
......
select
srvProp_SerName as srvProp_SerName,
getdate() as reportDateTime,
srvProp_BldClrVer as srvProp_BldClrVer,
srvProp_Collation as srvProp_Collation,
.....
.....
from @tb1_SvrStng