SQL Server "Warning: Null value is eliminated by an aggregate or other SET operation." I am not using avg() or sum() or count() [closed]

watbbzwu  于 2023-03-28  发布在  其他
关注(0)|答案(1)|浏览(237)

Closed. This question needs debugging details . It is not currently accepting answers.

Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem . This will help others answer the question.

Closed 3 days ago.
Improve this question

I am trying to run the following code but I get the error in the title. It inserts nothing in vra.dbo.ftpaudit

Declare @FTPAudit table  (FileId Int, OldFTPXML XML, OldAttributesXML XML, Active Int, Production Int, Status int, CallType varchar, CallObj varchar)

        Insert Into @FTPAudit (FileId , OldFTPXML , OldAttributesXML , Active , Production , Status , CallType , CallObj )
        EXEC [dbo].[p_mFTP_GetAudit] @FileIdList = 5904
    
        Insert into vra.dbo.ftpaudit   ( [OldFTPXML],[NewFTPXML],[OldAttributesXML] ,[NewAttributesXML],[UpdateTime] ,[UserId],[FileId] ,[Active] ,[Production] ,[UpdateStatus] ,[Deleted],[MasterFileId] ,[Status] ,[CallType]  ,[CallObject])
        Select  OldFTPXML, '',OldAttributesXML, '', Getdate(), 123, FileID, Active, Production,  '',   '',  '',  Status,  'S',     'p_mFTP_SubmitHistReq'
        from @FTPAudit

I am trying to run the above query in order to insert vra.dbo.FTPAudit the values captured in @FTPAudit

Please not that [dbo].[p_mFTP_GetAudit] has no sum(), avg() or any other function inside

Anyone any clue why it inserts nothing in the FTPAudit table? I lost 2 hours already

FTPAudit table

Query without insert return this

Insert result

bzzcjhmw

bzzcjhmw1#

SOLUTION: In fact it was inserting but a simple select was returning only rows inserted by other sps.

I had to order by LogId desc to see the whole table. I don't know why is that

相关问题