title: SQL insert trigger to catch NULL values for mutiple rows
body: <p>I have written the trigger below that prevents from NULL being entered in the pch_x field . It works fine if i insert 1 row but doesnt work if I enter more than one at once . Could someone please help me out a little ? Here is my code </p>
  
  <pre><code>create trigger test 
  ON [dbo].TEMP
  for INSERT
  AS
  BEGIN 
  declare @xcheck varchar(50)
  set @xcheck= (select i.pch_x FROM temp L INNER JOIN INSERTED I
  ON L.id = I.id)
  F (@xcheck is NULL ) 
           begin 
           RAISERROR('NULL in pch_x', 16, 1) 
           ROLLBACK
           end 
  END
  </code></pre>