SQL Server Subquery a
<pre><code>create trigger suadulieu22
on SACH
for update
as
    if UPDATE(MaTG) or UPDATE(MaNXB)
    begin 
        rollback tran
        print ('khong cho phep sua du lieu o cot MaTG va MaNXB')
    end

    if UPDATE(DonGia)
        if((select DonGia from inserted) &gt;= 3600)
        begin
            rollback tran
            print 'don gia moi phai khong vuot qua 20% don gia cu '
        end

    update SACH
    set MaNXB = 'nxb1'
    where MaTG = 'tg1' and MaNXB = 'nxb1'

    update SACH
    set DonGia = 3060
    where MaTG = 'tg1' and MaNXB = 'nxb1'
</code></pre>

<p>Please help me, I get this error:</p>

<blockquote>
  <p>Msg 512, Level 16, State 1, Procedure suadulieu, Line 11<br>
  Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , >, >= or when the subquery is used as an expression.</p>
</blockquote>

<pre><code> if UPDATE(DonGia)
        if((select DonGia from inserted) &gt;= (select DonGia from inserted)*1.2)
        begin
            rollback tran
            print 'don gia moi phai khong vuot qua 20% don gia cu '
        end
update SACH
set DonGia = 3060
where MaTG = 'tg1' and MaNXB = 'nxb1'
</code></pre>