Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

Level11 failure in SQL Server Query when query runs from the SQL stored procedure

$
0
0

Hi,

   The below SQL Server query throws linked server error when run from the stored procedure.However, the same query runs fine, when run using SSMS.

Insert into [Server1].[tlArchive].[dbo].tblIntnAttachmentMap(nEventID,nAttachmentId) Select nEventID,nAttachmentId from tblIntnAttachmentMap with(nolock) inner join tblArchiveInstances with(nolock) on nArchObjectID =nAttachmentID where nArchObjectType = 68

Here Server1 is the different machine.

Same query is when run by stored procedure, throws below error:
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.

SQL Version info:

Microsoft SQL Server2008 R2 (SP2) x64

Microsoft SQL Server Management Studio                        10.50.4000.0
Microsoft Analysis Services Client Tools                        10.50.4000.0
Microsoft Data Access Components (MDAC)                        6.1.7600.16385
Microsoft MSXML                        3.0 4.0 5.0 6.0
Microsoft Internet Explorer                        8.0.7600.16385
Microsoft .NET Framework                        2.0.50727.4927
Operating System                        6.1.7600

Please help.

Thanks in advance.

regards,

Pradeep


Viewing all articles
Browse latest Browse all 5123

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>