title: Get the wrong line ID in ms sql
body: <p>I have an INSERT statment wich inserts large amount of data into tableA from tableB.<br>
  Here is a very simple code example:</p>
  
  <pre><code>INSERT [dbo].[tableA]
  SELECT   field1 [field_1] 
  FROM [dbo].[tableB]
  WHERE [codeID] IN (SELECT [codeID] FROM #tempTable WHERE RecordMarker = 1)
  </code></pre>
  
  <p>There is a temporary table wich holds codeIDs (at least 1 or more) needed to insert to tableA.</p>
  
  <p>But there would be incorrent data in tableB what cannot be inserted into tableA. For example an numberic(30,2) field cannot map to numeric(13,2). In this case I get an excetpion and the statement has been terminated. </p>
  
  <p>How can I get the CodeID or the wrong line number in tableB if I get an error? Now I have just the error message but no line number.</p>
  
  <p>For example:
  Msg 8115, Level 16, State 8, Line 1
  Arithmetic overflow error converting numeric to data type numeric.
  The statement has been terminated.</p>
  
  <p>EDIT: There are more than one field in the table with different field types. So the numeric type is just an example.</p>