Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8695

Re: Transaction Notification to show 'Line Number' in the Error message

$
0
0

Hi Gordon

I think that we might be talking about two different things. If the only thing to do is to find line numbers and present them to the end user and the condition is as simple as the one presented in the post above there is certainly no need to use cursor. Take a look at this code:

 

SELECT N'Error in lines: ' + (  SELECT cast(a.vis AS NVARCHAR(3)) + ';'  FROM (  SELECT t1.visorder + 1 'vis'  FROM dbo.OINV t0  JOIN dbo.INV1 t1 ON t0.DocEntry = t1.DocEntry  WHERE t1.Price < t1.GrossBuyPr  AND t1.DocEntry = 18  ) a  FOR XML path('')  ) 

Since my browser refuses to cooperate when I try to insert image I don't present estimated execution plan but you can check it on your own.

 

Kind regards,

Radek


Viewing all articles
Browse latest Browse all 8695

Trending Articles



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