gpt4 book ai didi

sql - SSIS 错误 : Unable to retrieve destination column descriptions from the parameters of the SQL command

转载 作者:行者123 更新时间:2023-12-04 18:23:50 27 4
gpt4 key购买 nike

SSIS task

我收到一个错误:

[Load updated records to Table_vwAs_FixedIdentifier [85]] Error: Unable to retrieve destination column descriptions from the parameters of the SQL command.

当我执行图像中的 SSIS 任务时。它在左下角“将更新的记录加载到 Table_vwAs..” oleDb 更新任务中失败。它有以下 sql 语句,还有一个触发器也如下所示。直到现在我还无法确定这个问题的原因。 当我禁用触发器时,任务成功运行。任何帮助都会令人大开眼界。

UPDATE
[dbo].[Sec]
SET
[SecID]=?
,[SECURITY_NAME]=?
,[SECURITY_SECTYPE_ID]=?
,[SECURITY_EXCHANGE_ID]=?
WHERE
[MasterID]=?

触发代码如下:

alter trigger [dbo].[TrTable_Fixed_AFTERUPDATE] on [dbo].[Sec]
after insert ,update
as
set NOCOUNT on

declare @DBMailDistributionListId varchar(50)
declare @ProfileName varchar(max)
declare @Recipients varchar(max)
declare @CopyRecipients varchar(max)
declare @BlindCopyRecipients varchar(max)
set @DBMailDistributionListId = 'Crossadyne1'
set @ProfileName = SharedCode.dbo.FnGetDBMailDistributionListProfileName(@DBMailDistributionListId)
set @Recipients = SharedCode.dbo.FnGetDBMailDistributionListRecipients(@DBMailDistributionListId)
set @CopyRecipients = SharedCode.dbo.FnGetDBMailDistributionListCopyRecipients(@DBMailDistributionListId)
set @BlindCopyRecipients = SharedCode.dbo.FnGetDBMailDistributionListBlindCopyRecipients(@DBMailDistributionListId)

declare @Subject varchar(max)
declare @Body varchar(max)
set @Body = ''

select distinct @Body = @Body + 'Master Sec ID: ' + convert(nvarchar(50) ,i.MasterId) + char(13) + char(10)
+ 'New Legal Entity ID: ' + convert(nvarchar(50) ,i.[INTERNAL_SECURITY_LEGALENTITY_ID])
from INSERTED i
inner join DELETED d
on i.MasterId = d.MasterId
where i.[INTERNAL_SECURITY_LEGALENTITY_ID] <> d.[INTERNAL_SECURITY_LEGALENTITY_ID]
and i.Security_Change_Date = i.LegalEntityChangeDate
and i.LegalEntityChangedBy not in (2 ,5)

if (@Body <> '')
begin

set @Subject = 'WARNING: Crossadyne Security Legal Entity changed'

exec msdb.dbo.sp_send_dbmail
@profile_name = @ProfileName
, @recipients = @Recipients
, @copy_recipients = @CopyRecipients
, @blind_copy_recipients = @BlindCopyRecipients
, @subject = @Subject
, @body = @Body

end


set @DBMailDistributionListId = 'test'
set @ProfileName = SharedCode.dbo.FnGetDBMailDistributionListProfileName(@DBMailDistributionListId)
set @Recipients = SharedCode.dbo.FnGetDBMailDistributionListRecipients(@DBMailDistributionListId)
set @CopyRecipients = SharedCode.dbo.FnGetDBMailDistributionListCopyRecipients(@DBMailDistributionListId)
set @BlindCopyRecipients = SharedCode.dbo.FnGetDBMailDistributionListBlindCopyRecipients(@DBMailDistributionListId)

set @Body = ''

select distinct @Body = @Body + 'Master ID: ' + convert(nvarchar(50) ,i.MasterId) + char(13) + char(10)
+ 'Previous Legal Entity ID: ' + convert(nvarchar(50) ,d.[INTERNAL_SECURITY_LEGALENTITY_ID])
from INSERTED i
inner join DELETED d
on i.MasterId = d.MasterId
where i.[INTERNAL_SECURITY_ID] <> d.[INTERNAL_SECURITY_LEGALENTITY_ID]

if (@Body <> '')
begin

set @Subject = 'WARNING: Crossadyne Security Legal Entity changed'

exec msdb.dbo.sp_send_dbmail
@profile_name = @ProfileName
, @recipients = @Recipients
, @copy_recipients = @CopyRecipients
, @blind_copy_recipients = @BlindCopyRecipients
, @subject = @Subject
, @body = @Body

end

set NOCOUNT off

最佳答案

问题是由于
引起的执行 msdb.dbo.sp_send_dbmail
在触发器代码中,因为它没有在 QA 服务器上配置。在我评论这些行后解决。

关于sql - SSIS 错误 : Unable to retrieve destination column descriptions from the parameters of the SQL command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54817506/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com